A command-line tool for adding watermarks to images and PDFs with support for batch processing and various watermark patterns. Designed to prevent identity theft and unauthorized copying of official documents through visible watermarking.
- Apply text watermarks with specific rotation.
- PDF as input is supported
- Process single images or recursively process directories
- Parallel processing for batch operations using Rayon
- Customizable watermark color and spacing and JPEG compression quality
- Rust and Cargo installed on your system
cargo install watermark-cliwindows-sys require some dll to build:
scoop install binutilsgit clone https://github.com/chianti-ga/watermark-cli.git
cd watermark-cli
cargo build --releasewatermark-cli <INPUT_PATH> <WATERMARK> [OPTIONS]<INPUT_PATH>- Path to the input image/pdf file or directory<WATERMARK>- Text to use as watermark
-c, --compression <COMPRESSION>- JPEG quality (1-100) [default: 90]-t, --text-scale <TEXT_SCALE>- Watermark text scale [default: 0.05"]-s, --space-scale <SPACE_SCALE>- Vertical spacing between watermarks [default: 1.5]-r, --recursive- Recursively apply watermark to all images in the specified directory-p, --pattern <PATTERN>- Pattern of watermark [default: diagonal] [possible values: diagonal, horizontal, vertical, random, cross-diagonal] (NOT IMPLEMENTED AT THE MOMENT)-h, --help- Print help-V, --version- Print version
Apply a diagonal watermark to a single image:
watermark-cli sample.png "ONLY FOR IDENTITY VERIFICATION BY RENTAL AGENCY"| Original file | Watermarked file |
|---|---|
![]() |
![]() |
- Image from ANTS/France Titres (https://ants.gouv.fr/)
Customize watermark height/scale and compression:
watermark-cli --text-scale 2.0 path/to/image.jpg "SAMPLE"Process all images in a directory recursively with a custom pattern:
watermark-cli --recursive --pattern horizontal path/to/directory/ "Confidential"Customize watermark spacing and compression:
watermark-cli --space-scale 2.0 --compression 80 path/to/image.jpg "SAMPLE"- JPEG/JPG
- PNG
- WebP
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
This project uses the Open Sans font, which is licensed under the SIL Open Font License, Version 1.1 . The font was designed by Steve Matteson and is available at https://fonts.google.com/specimen/Open+Sans.

