Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/python-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
dep = check_dependencies()
assert dep['ok'], f'Missing deps: {dep}'

img = np.random.randint(0, 256, (800, 800, 3), dtype=np.uint8)
img = np.random.default_rng(7).integers(0, 256, (800, 800, 3), dtype=np.uint8)

embedded = embed_watermark(
img,
Expand All @@ -49,7 +49,26 @@ jobs:
quality='balanced',
)
assert extracted['ok'], f'Extract failed: {extracted}'
assert extracted['wm'] == 'hello world', f'Roundtrip failed: {extracted}'
assert extracted['wm'].startswith('fp:'), f'Fingerprint roundtrip failed: {extracted}'
assert extracted.get('payloadMode') == 'fingerprint64', extracted

text16_embedded = embed_watermark(
img,
'hello world',
password=42,
quality='balanced',
payload_mode='text16',
)
assert text16_embedded['ok'], f'Text16 embed failed: {text16_embedded}'

text16_extracted = extract_watermark(
text16_embedded['image'],
password=42,
quality='balanced',
payload_mode='text16',
)
assert text16_extracted['ok'], f'Text16 extract failed: {text16_extracted}'
assert text16_extracted['wm'] == 'hello world', f'Text16 roundtrip failed: {text16_extracted}'

print('All tests passed.')

Expand Down
4 changes: 2 additions & 2 deletions blind_watermark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ It is a heavily modified version of the original [blind_watermark](https://githu

## Modifications in LuminCrypt

- **Adaptive Quality Profiles**: Dynamically adjusts Reed-Solomon error correction (`rs_nsym`) and block redundancy based on selected quality (invisible, balanced, robust).
- **Adaptive Quality Profiles**: Dynamically adjusts Reed-Solomon error correction (`rs_nsym`) and block redundancy for the legacy engine, plus six neural visibility/robustness profiles (trace, faint, light, balanced, strong, robust). Low-visibility neural profiles use keyed Y-channel DCT spread-spectrum embedding to avoid visible grid or line patterns.
- **Multi-scale Embedding & Extraction**: Embeds the watermark at multiple resolutions (e.g., 1.0x, 0.75x, 0.5x) to resist severe downscaling and platform compression.
- **Enhanced Synchronization**: Uses a dual-ring, multi-peak template for better resistance against rotation, cropping, and aspect ratio changes.
- **Edge Exclusion**: Avoids embedding watermarks in the outermost edges of the image where cropping is most likely to occur.
Expand All @@ -14,4 +14,4 @@ It is a heavily modified version of the original [blind_watermark](https://githu

## License

The original code is licensed under the MIT License. See the `NOTICE` file in the root directory for full copyright and license details.
The original code is licensed under the MIT License. See the `NOTICE` file in the root directory for full copyright and license details.
Loading