Image compress using Rust
This is a fork of Pio to adapt multiple platforms, not even CLI or desktop.
Big thanks.
- Optimize images automatically for the app, web.
- Supports PNG, JPEG and WebP
- Ensure images are displayed consistently across browsers by handling ICC profiles and Exif orientation
- Powered by great projects like mozjpeg and pngquant
- Easily installable statically-linked binary (for Android, iOS, Flutter, React Native, web apps, desktop apps, and even terminal CLI).
Let's contribute, folks.
Build from source
cargo install cargo-lipothen
cargo lipo --releaseto generate a bundle named libcomp.a for iOS and use this bundle to integrate with your apps.
Or can use latest bundle file from releases
Download the latest Linux & macOS binary from releases. These versions are built on Ubuntu 22.04.3 LTS and macOS Sonoma 14.0
After downloading the binary, run chmod +x path-to-comp to make it executable.
Consider storing the binary somewhere on your PATH like /usr/local/bin/comp.
Copy downloaded binary to local bin:
sudo cp path-to-comp /usr/local/bin/compMake binary excutable:
sudo chmod +x /usr/local/bin/compCheckout this repository Rust Image Compress Flutter Example
comp input.jpeg --output output.jpegThe target quality can be set using --quality option:
comp input.jpeg --quality 95 --output output.jpegThe target quality is a value between 0 and 100 and roughly corresponds to JPEG quality values.
For the full list of available options, run
comp --help