cjxl-rs
Command-line JPEG XL encoder. Pure Rust, #![forbid(unsafe_code)].
Wraps jxl-encoder — see that crate for library usage.
Install
Usage
# Lossy (distance 1.0 = visually lossless)
# Lossless
# Quality mode (0-100, maps to distance internally)
Reads PNG (including APNG animation). Writes bare JXL codestream or container format (when metadata or animation is present).
Flags
| Flag | Default | Description |
|---|---|---|
-d, --distance |
1.0 | Butteraugli distance (0 = lossless, 1.0 = visually lossless) |
-q, --quality |
90 | Quality 0-100 (alternative to distance) |
-e, --effort |
7 | Effort 1-10 (higher = slower, better compression) |
--lossless |
off | Lossless modular encoding |
--no-gaborish |
on | Disable gaborish pre-filter |
--no-pixel-domain-loss |
on | Disable pixel-domain loss (faster, lower quality) |
--no-ans |
ANS on | Use Huffman instead of ANS |
--no-optimize-codes |
on | Single-pass static Huffman (streaming) |
--dct8-only |
off | Force DCT8 only |
--noise |
off | Enable noise synthesis |
--denoise |
off | Wiener denoising pre-filter (implies --noise) |
--no-error-diffusion |
on | Disable error diffusion |
--lz77 |
off | Enable LZ77 backward references (ANS two-pass only) |
--tree-learning |
off | Content-adaptive MA tree for lossless |
--squeeze |
off | Haar wavelet transform for lossless |
--no-butteraugli |
on | Disable butteraugli quantization loop |
--icc FILE |
none | Embed ICC profile |
--exif FILE |
none | Embed EXIF metadata |
--xmp FILE |
none | Embed XMP metadata |
License
Dual-licensed: AGPL-3.0 or commercial.
I've maintained and developed open-source image server software — and the 40+ library ecosystem it depends on — full-time since 2011. Fifteen years of continual maintenance, backwards compatibility, support, and the (very rare) security patch. That kind of stability requires sustainable funding, and dual-licensing is how we make it work without venture capital or rug-pulls. Support sustainable and secure software; swap patch tuesday for patch leap-year.
Your options:
- Startup license — $1 if your company has under $1M revenue and fewer than 5 employees. Get a key →
- Commercial subscription — Governed by the Imazen Site-wide Subscription License v1.1 or later. Apache 2.0-like terms, no source-sharing requirement. Sliding scale by company size. Pricing & 60-day free trial →
- AGPL v3 — Free and open. Share your source if you distribute.
See LICENSE-COMMERCIAL for details.
Upstream
Upstream code from libjxl/libjxl is licensed under BSD-3-Clause.
Our additions and improvements are dual-licensed (AGPL-3.0 or commercial) as above.