A fast image optimization tool. Convert, compress, resize, crop, and extend images using modern codecs — available as a CLI and desktop GUI.
| Format | Decode | Encode | Notes |
|---|---|---|---|
| JPEG | Yes | Yes | MozJPEG encoder for superior compression |
| PNG | Yes | Yes | OxiPNG optimizer with Zopfli compression |
| WebP | Yes | Yes | Lossy encoding via libwebp |
| AVIF | Yes | Yes | ravif encoder; dav1d decoder (statically linked) |
| QOI | Yes | Yes | Lossless, fast encode/decode |
| JPEG XL | Yes | Yes | libjxl encoder/decoder |
cargo install slimg
brew install clroot/tap/slimg
Download from GitHub Releases:
| Platform | File |
|---|---|
| macOS (Apple Silicon) | slimg-aarch64-apple-darwin.tar.xz |
| macOS (Intel) | slimg-x86_64-apple-darwin.tar.xz |
| Linux (x86_64) | slimg-x86_64-unknown-linux-gnu.tar.xz |
| Linux (ARM64) | slimg-aarch64-unknown-linux-gnu.tar.xz |
| Windows (x86_64) | slimg-x86_64-pc-windows-msvc.zip |
git clone https://github.com/clroot/slimg.git
cd slimg
cargo install --path cli
- Rust 1.85+ (edition 2024)
- C compiler (cc)
- nasm (for MozJPEG / rav1e assembly optimizations)
- meson + ninja (for building dav1d AVIF decoder from source)
- Set
SYSTEM_DEPS_DAV1D_BUILD_INTERNAL=alwaysto build dav1d from source
For the full usage guide, see docs/usage.md.
# Convert format
slimg convert photo.jpg --format webp
# Optimize (re-encode in same format)
slimg optimize photo.jpg --quality 70
# Resize
slimg resize photo.jpg --width 800
# Crop by coordinates
slimg crop photo.jpg --region 100,50,800,600
# Crop to aspect ratio (center-anchored)
slimg crop photo.jpg --aspect 16:9
# Extend to square with padding
slimg extend photo.jpg --aspect 1:1
# Extend with transparent background
slimg extend photo.png --aspect 1:1 --transparent
# Batch processing with format conversion
slimg convert ./images --format webp --output ./output --recursive --jobs 4A cross-platform desktop application built with Tauri v2 + React.
- Drag & drop file/folder input
- Before/after image comparison preview
- Batch processing with real-time progress
- Configurable quality and format settings
Download from GUI Releases (macOS, Linux, Windows).
See docs/benchmarks.md for detailed performance measurements across all codecs and pipeline operations.
| Language | Package | Platforms |
|---|---|---|
| Kotlin/JVM | io.clroot.slimg:slimg-kotlin |
macOS, Linux, Windows |
| Python | slimg |
macOS, Linux, Windows |
The core functionality is available as a library crate (slimg-core):
use slimg_core::*;
// Decode an image file
let (image, format) = decode_file(Path::new("photo.jpg"))?;
// Convert to WebP
let result = convert(&image, &PipelineOptions {
format: Format::WebP,
quality: 80,
resize: None,
crop: None,
extend: None,
fill_color: None,
})?;
// Save the result
result.save(Path::new("photo.webp"))?;MIT