Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

cjxl

$ cjxl Foundation Low Risk
libjxl · AI & Media · BSD-3-Clause · macos / linux / windows

cjxl 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.

FCRS-1.0 Score
81 /100
Good
High Confidence
Zero-Friction Install
brew install jpeg-xl
CLI vs MCP Decision CLI Only

Local JPEG XL encoding and jxlinfo inspection run directly against disk assets without MCP.

Agent-Readiness Checklist

Local Probe Evidence
— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md
Version
cjxl v0.11.2 0.11.2 [NEON_BF16,NEON]
Startup
33 ms
Exit Codes (help / invalid)
0 / 1
NO_COLOR Clean / Non-TTY Safe
Yes / Safe
Captured --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

Agent-Readiness 18 / 25

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
Trust & Safety 20 / 25

Never alters input images, though overwrites the explicit OUTPUT path silently if a file already exists there.

  • Source file untouched; lacks --no-overwrite guard on destination path
Setup & Portability 13 / 15

Distributed via brew install jpeg-xl and GitHub releases across macOS, Linux, and Windows.

  • Available via Homebrew jpeg-xl and official releases
Utility & Efficiency 13 / 15

Unique reversible lossless JPEG-to-JXL transcoding (~20% smaller) alongside modern HDR/alpha compression.

  • Losslessly transcodes legacy JPEGs with -d 0 and restores exact JPEG bytes via djxl
Maintenance & Lineage 9 / 10

Official libjxl/libjxl reference repository under BSD-3-Clause.

  • Maintained by libjxl project
Docs & Verifiability 8 / 10

Clear cjxl -h output and man documentation explaining --distance vs --quality mutual exclusivity.

  • Documented in doc/man/cjxl.txt and cjxl -h

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates on local image files.

Side Effects
Read-Only Local Write
Cost & Quotas

Free BSD-3-Clause open-source binary suite.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Inspect JXL codestream properties
jxlinfo image.jxl

Uses companion jxlinfo from jpeg-xl to inspect dimensions, bit depth, and animation without decoding.

Check cjxl version and SIMD support
cjxl --version

Prints encoder version and hardware SIMD capabilities without modifying files.

Controlled Writes & Previews

Encode PNG to visually lossless JXL
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 via djxl.
  • + Provides --quiet mode and clean --distance / --effort quality knobs.

Caveats & Pitfalls

  • ! Silently overwrites OUTPUT if it already exists; no --no-overwrite flag.
  • ! --distance and --quality are mutually exclusive and will error if combined.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI