/filigram-rs

Watermark images efficiently

Primary LanguageRust

Filigram-rs

This library is a convenient wrapper to watermark image files in a folder, recursively.

original watermarked

Input folder is copied entirely, applying watermark on image files, depending on some exclusion/inclusion rules. If a file is excluded from watermarking, it is simply copied to destination without any change.

Watermarking process:

  • watermark text (customizable) is applied
  • image is resized to a fixed size of 500x500
  • process is multithreaded using rayon crate
  • recopy source image Exif metadata and ICC profile to output image

Compatibility

This library is compatible with:

  • Linux (x86_64-unknown-linux-gnu)
  • Windows (x86_64-pc-windows-gnu)
  • WASI (wasm32-wasi)

Build the library

cargo build --release

For Windows:

cargo build --release --target x86_64-pc-windows-gnu

Note: package mingw-w64 may be required for cross-compilation.

On Ubuntu, run sudo apt-get install mingw-w64

For WASI:

cargo build --release --target wasm32-wasi

Run the example

A simple example is provided in the subfolder examples to illustrate how to use the library.

cargo run --release --example filigram