cjxl
$ cjxl Foundation Low Riskcjxl is the reference libjxl encoder that converts PNG, APNG, GIF, EXR, and JPEG files into JPEG XL (.jxl), including mathematically lossless recompression of existing JPEGs (-d 0). It pairs with djxl and jxlinfo from the jpeg-xl package.
brew install jpeg-xl Local JPEG XL encoding and jxlinfo inspection run directly against disk assets without MCP.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
Usage: cjxl INPUT OUTPUT [OPTIONS...]
INPUT
the input can be JXL, PPM, PNM, PFM, PAM, PGX, PNG, APNG, GIF, JPEG, EXR
OUTPUT
the compressed JXL output file
Basic options:
-d DISTANCE, --distance=DISTANCE
Target visual distance in JND units, lower = higher quality.
0.0 = mathematically lossless. Default for already-lossy input (JPEG/GIF).
1.0 = visually lossless. Default for other input.
Recommended range: 0.5 .. 3.0. Allowed range: 0.0 ... 25.0. Mutually exclusive with --quality.
-q QUALITY, --quality=QUALITY
Quality setting, higher value = higher quality. This is internally mapped to --distance.
100 = mathematically lossless. 90 = visually lossless.
Quality values roughly match libjpeg quality.
Recommended range: 68 .. 96. Allowed range: 0 .. 100. Mutually exclusive with --distance.
-e EFFORT, --effort=EFFORT
Encoder effort setting. Range: 1 .. 10.
Default: 7. Higher numbers allow more computation at the expense of time.
For lossless, generally it will produce smaller files.
For lossy, higher effort should more accurately reach the target quality.
-V, --version
Print encoder library version number and exit.
--quiet
Be more silent
-v, --verbose
Verbose output; can be repeated and also applies to help (!).
-h, --help
Prints this help message. Add -v (up to a total of 4 times) to see more options.
JPEG XL encoder v0.11.2 0.11.2 [NEON_BF16,NEON] FCRS-1.0 6-Dimension Breakdown
Non-interactive GNU-style CLI with --quiet and clear --help, though lacks JSON output, --dry-run, and --no-overwrite.
- Supports
--quiet,--distance, and--effort - No JSON output or
--dry-run
Never alters input images, though overwrites the explicit OUTPUT path silently if a file already exists there.
- Source file untouched; lacks
--no-overwriteguard on destination path
Distributed via brew install jpeg-xl and GitHub releases across macOS, Linux, and Windows.
- Available via Homebrew
jpeg-xland official releases
Unique reversible lossless JPEG-to-JXL transcoding (~20% smaller) alongside modern HDR/alpha compression.
- Losslessly transcodes legacy JPEGs with
-d 0and restores exact JPEG bytes viadjxl
Official libjxl/libjxl reference repository under BSD-3-Clause.
- Maintained by
libjxlproject
Clear cjxl -h output and man documentation explaining --distance vs --quality mutual exclusivity.
- Documented in
doc/man/cjxl.txtandcjxl -h
Security, Auth & Guardrails
None required; operates on local image files.
Free BSD-3-Clause open-source binary suite.
# cjxl Agent Rules - Check whether the target `output.jxl` exists before invoking `cjxl`, as it has no `--no-overwrite` flag. - Use `--distance 0.0` for lossless JPEG transcoding (reversible byte-for-byte with `djxl`), and `--quiet` to suppress progress output.
Agent-Ready Command Recipes
Safe Read-Only Queries
jxlinfo image.jxl
Uses companion jxlinfo from jpeg-xl to inspect dimensions, bit depth, and animation without decoding.
cjxl --version
Prints encoder version and hardware SIMD capabilities without modifying files.
Controlled Writes & Previews
cjxl --quiet input.png output.jxl --distance 1.0
Compresses input.png to output.jxl at perceptual distance 1.0 with quiet output.
Strengths for Agents
- + Losslessly transcodes existing JPEGs to
.jxl(-d 0.0) with bit-exact reconstruction viadjxl. - + Provides
--quietmode and clean--distance/--effortquality knobs.
Caveats & Pitfalls
- ! Silently overwrites
OUTPUTif it already exists; no--no-overwriteflag. - !
--distanceand--qualityare mutually exclusive and will error if combined.