Crates.io | color_watermark |
lib.rs | color_watermark |
version | 0.1.2 |
source | src |
created_at | 2024-06-22 01:41:54.873221 |
updated_at | 2024-06-22 07:17:43.328353 |
description | An easy-to-use crate to embed color watermarks, using DCT and QIM-DM |
homepage | |
repository | https://github.com/haroldxie2308/color_watermark |
max_upload_size | |
id | 1280125 |
size | 40,469 |
This is a rust implementation of the 2018 paper A Robust Watermarking Scheme to JPEG Compression for Embedding a Color Watermark into Digital Images by David-Octavio Muñoz-Ramirez, Volodymyr Ponomaryov, Rogelio Reyes-Reyes, Volodymyr Kyrychenko, Oleksandr Pechenin and Alexander Totsky. Many thanks to the authors for such a wonderful idea!
Prepare a 512 * 512 host image and 128 * 128 watermark image in RGB encoding.
let key = 123456;
let step_size = 50.0;
let watermarked_img = embed_watermark("path/to/host_image", "path/to/watermark", key, step_size);
watermarked_img.save("path/to/watermarked_img");
// Return value: (BitVec, DynamicImage)
let (_, extracted_wm) = extract_watermark("path/to/watermarked_img", key, step_size);
extracted_wm.save("path/to/extracted_wm");