A high-performance, concurrent, multithreaded image converter written entirely in Rust. This tool allows for the bulk or single conversion of images to the compressed WebP format via a command-line interface (CLI). It's designed with static configurations derived from extensive experience in eCommerce image management, specifically tailored to the needs encountered during my tenure as an eCommerce Manager at Adam Medical Company.
Concurrent & Multithreaded: Leverages Rust's powerful concurrency model for efficient image processing. Bulk & Single Image Conversion: Supports processing an entire folder of images or a single image file. Compressed WebP Format: Converts images to the WebP format, optimizing for high compression with minimal quality loss. Static Configurations: Utilizes pre-defined settings optimized through professional experience in eCommerce image optimization. CLI Interface: Easy-to-use command-line interface for straightforward operation. Installation (Include steps for installing Rust, if necessary, and building or installing your project.)
Ensure you have Rust installed on your system. You can download it from https://rustup.rs/.
git clone https://github.com/theHamdiz/webp_converter.git
cd webp_converter
cargo build --release
The executable can be found in ./target/release/.
To use the Rust WebP Image Converter, you can utilize the following command-line arguments:
-p
: Path to an image file or folder containing images to convert.
-l
: A boolean toggle (true/false) to indicate whether file compression should be lossless or lossy.
Defaults to true.
-q
: A number between 0 and 100 to indicate the quality of the compressed image.
Defaults to 75.
-c
: A number between 0 and 6 to indicate the compression factor of the compressed image.
Defaults to 2.
-s
: A boolean to indicate whether the image should be resized to (700x700)px or the nearest equivalent.
Defaults to false.
-n
: Noise Ratio or PSNR Determines Noise to Signal Ratio.
Defaults to 40.
-V
: Display the program version.
-h
: Display the help menu with usage information.
-r
: A boolean to indicate whether the program should recursively work on internal folders.
Note: this feature is not yet implemented
Convert a single image with 3X compression:
./webp_converter -p /path/to/image.png -c 3 -s true
On windows
that would be:
.\webp_converter.exe -p "path\to\image" -c 3 -s true
Convert all images in a folder without compression:
./webp_converter -p /path/to/folder -c 0 -q 100
Display the version of the program:
./webp_converter -V
Feel free to contribute to this command line tool by submitting pull requests.
MIT License