1 unstable release
| 0.3.0 | Oct 19, 2025 |
|---|
#123 in Images
123 downloads per month
48KB
1K
SLoC
Welcome to Cargo Imagermachine 👋
Rust cli for batch optimizing images
Cargo-imagermachine was designed as a subtool of cargo package manger, so user can run the interactive cli from the command line inside folders that contain pictures.
Imagermachine uses turbo-jpeg library for jpeg files optimization and oxi png for png images. You must install the turbo-jpeg yourself as the cli uses only the bindings to the turbo-jpeg library. Installation guide for respective systems below.
Imagermachine can:
- Optimize png and jpg images.
- Resize and crop images.
- Rename the transformed files based on providedname(index).ext
- Convert files to Webp
- todo: set optimalisation custom config
Dependencies
So far the cli has been tested on unix systems (Debian, Mac).
Before using cargo-imagermachine you must install
Rust
Follow the official guideline for installing rust on your system https://www.rust-lang.org/tools/install
Libturbojpeg
Offical webiste and documentation 👉 https://www.libjpeg-turbo.org/
Debian
sudo apt-get install libturbojpeg libturbojpeg0-dev cmake nasm
This should be enough to get started on Ubuntu
Mac
brew install jpeg-turbo
! Remember to copy all the export paths that brew will print out after installation, I am using the following config in the cargo.toml file, pkg-config (also via brew) installation is needed for this setup to work.
turbojpeg = {version = "0.4", features = ["image", "pkg-config"]}
If you have troubles linking the cli to your libturbo, you can try to edit the cargo.toml file and add feature flags into turbojpeg features array, for more reference follow this link.
Install
In order to install cargo-imagermachine on your computer, clone the project then run the following command from the project folder:
cargo install --path .
Usage
If you followed the offical rust documentation and cargo / rustc is in scope, navigate to a input folder and run
cargo imagermachine
Follow directions on the interactive cli to optimize, resize, rename the images.
Author
👤 Lukasz Celitan
- Website: https://spaceout.pl
- Twitter: @spaceoutPL
- Github: @MassivDash
- LinkedIn: @luke-celitan-99920b168
Show your support
Give a ⭐️ if this project helped you!
Dependencies
~29–44MB
~675K SLoC