Back to browse
GitHub Repository

Image optimization CLI & library — convert, optimize, resize (JPEG, PNG, WebP, AVIF, QOI)

90 starsRust

Slimg – Fast Image Optimizer CLI in Rust with Kotlin/Python Bindings

by clroot·Feb 18, 2026·1 point·0 comments

AI Analysis

●●SolidWizardryShip It

Rust CLI with Kotlin/Python bindings and multi-codec support, but ImageMagick already dominates.

Strengths
  • UniFFI bindings for Kotlin/JVM and Python enable server-side and scripting integration without native code
  • Modern codec stack (ravif, OxiPNG, MozJPEG) with statically-linked dav1d avoids system dependency hell
  • Cross-platform binaries and Homebrew distribution lower friction for macOS/Linux adoption
Weaknesses
  • Image processing via CLI is well-trodden territory: ImageMagick, libvips, and GraphicsMagick already exist
  • No benchmarks comparing speed/compression quality against established tools in docs/benchmarks.md
Target Audience

Backend developers, DevOps engineers, image processing pipelines

Similar To

ImageMagick · libvips · GraphicsMagick

Post Description

Hi HN,

I built slimg, a CLI tool for image optimization written in Rust. It handles format conversion, compression, resizing, cropping, and extending (adding padding) — with batch processing support.

Codecs: MozJPEG, OxiPNG (Zopfli), libwebp, AVIF (ravif/dav1d), QOI, JPEG XL (decode-only).

## Example usage:

slimg convert photos/ --format webp --output out/ --recursive --jobs 4

slimg optimize photo.jpg --quality 70

slimg resize photo.jpg --width 800

slimg crop photo.jpg --aspect 16:9

Beyond the CLI, the core library (slimg-core) is on crates.io, and I also built language bindings via UniFFI:

- Kotlin/JVM (Maven Central): fluent API for server-side image processing

- Python (PyPI): for scripting and pipeline integration

## Install:

cargo install slimg

brew install clroot/tap/slimg

pip install slimg

All five platforms supported (macOS/Linux/Windows, x86_64/ARM64).

GitHub: https://github.com/clroot/slimg

Similar Projects

Developer Tools●●●Banger

BoltFFI a high performance Rust bindings generator

Zero-copy FFI approach cuts UniFFI overhead by 200–1000x; async maps to native patterns.

WizardryBig BrainZero to One
alihilal94
213mo ago