| Crates.io | imgshrink |
| lib.rs | imgshrink |
| version | 0.1.10 |
| created_at | 2025-12-13 15:14:26.913245+00 |
| updated_at | 2025-12-20 22:44:57.294614+00 |
| description | Fast CLI tool to batch-resize images |
| homepage | |
| repository | https://github.com/mariustz/imgshrink |
| max_upload_size | |
| id | 1983035 |
| size | 76,229 |
A fast, cross-platform CLI tool written in Rust for batch-resizing and converting images.
imgshrink is designed to efficiently process large numbers of images using parallel CPU processing, making it ideal for photographers, developers, and automation workflows.
If you have Rust installed:
cargo install imgshrink
Verify:
imgshrink --help
Download a precompiled binary from GitHub Releases:
๐ https://github.com/mariustz/imgshrink/releases
imgshrinkimgshrink.exePlace it somewhere in your PATH.
Resize all images in a directory:
imgshrink --input ./images --output ./out --width 800
imgshrink --input ./images --output ./out --width 800 --height 600
Convert images to PNG (use --to-format):
imgshrink --input ./images --output ./out --to-format png
imgshrink \
--input ./images \
--output ./out \
--width 1024 \
--format png
The --output path is required. To overwrite files in-place you can set --output to the same directory as the input (and use --overwrite), for example:
imgshrink --input ./images --output ./images --width 500 --overwrite
Note: writing into the input directory is supported but be careful โ using a separate output directory is safer.
Resize images
Usage: imgshrink.exe [OPTIONS] --output <OUTPUT> [PATH]
Arguments:
[PATH]
Options:
-i, --input <INPUT>
-o, --output <OUTPUT>
-r, --recursive
--ext <EXTENSIONS> [default: jpg,jpeg,png]
--width <WIDTH>
--height <HEIGHT>
--max-width <MAX_WIDTH>
--max-height <MAX_HEIGHT>
--scale <SCALE>
--hq
--overwrite
--jpeg-quality <JPEG_QUALITY> [default: 90]
--to-format <TO_FORMAT>
--no-parallel
--jobs <JOBS>
-v, --verbose Increase verbosity (use -v, -vv for more)
-h, --help Print help
-V, --version Print version
Notes:
--jobs N to limit the worker threads for this run; a local Rayon thread pool is used so other libraries won't be affected.-v/-vv or the RUST_LOG environment variable (e.g., RUST_LOG=debug).This makes imgshrink especially fast for large image collections.
Run all tests:
cargo test
Clone and build:
git clone https://github.com/mariustz/imgshrink.git
cd imgshrink
cargo build --release
Apache License, Version 2.0
Contributions, issues, and feature requests are welcome!
Built with:
Happy resizing! ๐