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 provided_name_(index).ext
- Convert files to Webp
- todo: set optimalisation custom config
So far the cli has been tested on unix systems (Debian, Mac).
Before using cargo-imagermachine you must install
Follow the official guideline for installing rust on your system https://www.rust-lang.org/tools/install
Offical webiste and documentation ๐ https://www.libjpeg-turbo.org/
Debian
sudo apt-get install libturbojpeg libturbojpeg0-dev
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.
In order to install cargo-imagermachine on your computer, clone the project then run the following command from the project folder:
cargo install --path .
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.
๐ค Lukasz Celitan
- Website: https://spaceout.pl
- Twitter: @spaceoutPL
- Github: @MassivDash
- LinkedIn: @luke-celitan-99920b168
Give a โญ๏ธ if this project helped you!