blind_watermark
Blind&Invisible Watermark ,图片盲水印,提取水印无须原图!
blind_watermark is a Python library for hiding invisible watermarks inside images that survive cropping, rotation, and noise, and can be extracted later without needing the original image.
blind_watermark is a Python library for embedding hidden watermarks inside images and then extracting them later, without needing the original image at extraction time. That is what the word "blind" means here: the extraction process works on a modified or attacked copy of the image on its own.
The watermark is invisible to the human eye. It is embedded by applying a chain of mathematical transforms to the pixel data, specifically the DWT (discrete wavelet transform), DCT (discrete cosine transform), and SVD (singular value decomposition). The result looks identical to the original image, but contains a hidden message that can later be decoded.
What makes the approach practical for copyright protection is that the watermark survives common modifications to the image. The readme shows a table of attack tests: rotating the image 45 degrees, cropping a random section, adding masks or noise, resizing it, or reducing its brightness all leave the embedded watermark recoverable. This means someone cannot easily strip or destroy the watermark by casually editing the image.
You can embed text strings, small image files, or raw binary data as the watermark payload. A password is used at both embed and extract time, so the watermark is keyed and cannot be read by someone who does not know the password. The library can use multiple CPU cores in parallel to speed up processing on large images.
Installation is through pip, the standard Python package manager. The command-line tool lets you embed and extract watermarks with a single shell command. A Python API is also available for use inside scripts or other programs. The project is available on Windows, Linux, and macOS and requires Python 3.5 or newer.
Where it fits
- Embed a hidden copyright notice in images you publish online so you can prove ownership if they are stolen.
- Watermark photos with a password-protected identifier before sharing so only you can extract and verify the mark.
- Track where a confidential image was leaked by embedding different watermarks in copies sent to different recipients.
- Process large batches of images in parallel to add invisible ownership marks before distribution.