CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

cjxl

$ cjxl 基金会 低风险
libjxl · AI 能力与音视频 · BSD-3-Clause · macos / linux / windows

cjxl 是 libjxl 官方参考编码器,可将 PNG、APNG、GIF、EXR 与 JPEG 转换为 JPEG XL(.jxl),并支持对现有 JPEG 进行数学无损重压缩(-d 0)。它与 jpeg-xl 软件包中的 djxl 及 jxlinfo 配套使用。

FCRS-1.0 综合评分
81 /100
良好 (Good)
高置信度 (实测)
零摩擦安装命令
brew install jpeg-xl
CLI vs MCP 选型建议 仅 CLI 可用

本地 JPEG XL 编码与 jxlinfo 检查直接针对磁盘资产运行,无需 MCP。

Agent 友好度体检单

本地探针实测证据
— 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
✓ 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md
实测版本
cjxl v0.11.2 0.11.2 [NEON_BF16,NEON]
冷启动耗时
33 ms
退出码 (help / 非法参数)
0 / 1
NO_COLOR 无色码污染 / 无 TTY 不挂起
Yes / Safe
抓取的 --help 摘要
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 六维评分拆解

Agent 友好度 18 / 25

非交互式 GNU 风格 CLI,支持 --quiet 与清晰的 --help,但缺少 JSON 输出、--dry-run 与 --no-overwrite。

  • Supports --quiet, --distance, and --effort
  • No JSON output or --dry-run
安全与权限边界 20 / 25

绝不修改源图像,但若目标 OUTPUT 路径已有文件则会静默覆盖。

  • Source file untouched; lacks --no-overwrite guard on destination path
安装与运行摩擦 13 / 15

通过 brew install jpeg-xl 与 GitHub Releases 覆盖 macOS、Linux 与 Windows。

  • Available via Homebrew jpeg-xl and official releases
能力覆盖与边际价值 13 / 15

独具可逆无损 JPEG 转 JXL 能力(体积缩减约 20%),同时支持现代 HDR 与透明通道压缩。

  • Losslessly transcodes legacy JPEGs with -d 0 and restores exact JPEG bytes via djxl
维护与来源背书 9 / 10

libjxl/libjxl 官方参考仓库,采用 BSD-3-Clause 协议。

  • Maintained by libjxl project
文档与可验证性 8 / 10

cjxl -h 输出与手册文档清晰解释了 --distance 与 --quality 互斥规则。

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

安全边界、鉴权与放权指南

鉴权方式
无需鉴权
凭证存储位置

无需凭据;仅处理本地图像文件。

潜在副作用
只读查询 本地写入
费用与配额提示

免费,基于 BSD-3-Clause 协议的开源二进制工具套件。

可复制到 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 高频安全命令配方

只读查询(安全推荐)

检查 JXL 码流属性
jxlinfo image.jxl

使用 jpeg-xl 随附的 jxlinfo 查看尺寸、位深与动画信息,无需完整解码。

检查 cjxl 版本与 SIMD 指令集支持
cjxl --version

打印编码器版本与硬件 SIMD 加速能力,不修改任何文件。

受控写入与预演

将 PNG 编码为视觉无损 JXL
cjxl --quiet input.png output.jxl --distance 1.0

以视觉距离 1.0 将 input.png 静默压缩为 output.jxl。

核心优势

  • + 可将既有 JPEG 无损转码为 .jxl(-d 0.0),并能通过 djxl 逐字节无损还原。
  • + 提供 --quiet 静默模式以及直观的 --distance / --effort 控制旋钮。

注意事项与踩坑点

  • ! 若 OUTPUT 已存在会静默覆盖,缺少 --no-overwrite 保护标志。
  • ! --distance 与 --quality 互斥,同时传入会报错。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI