Linux command
cjxl 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Encode
cjxl [input.png] [output.jxl]
Encode with a specific quality
cjxl -q [90] [input.png] [output.jxl]
Encode with lossless
cjxl -q [100] [input.png] [output.jxl]
Encode with a specific effort
cjxl -e [7] [input.png] [output.jxl]
Losslessly transcode
cjxl --lossless_jpeg=1 [input.jpg] [output.jxl]
Encode with specific distance
cjxl -d [1.0] [input.png] [output.jxl]
说明
cjxl is the reference encoder for JPEG XL, a next-generation image format designed to replace both JPEG and PNG. It is part of the libjxl project maintained by the JPEG committee. JPEG XL offers superior compression compared to legacy formats, supporting both lossy and lossless modes. A unique feature is the ability to losslessly transcode existing JPEG files, reducing their size by approximately 20% while allowing perfect reconstruction of the original JPEG. The encoder supports a wide range of input formats including PNG, APNG, GIF, JPEG, PPM, and PFM. It handles high bit depths, HDR content, and animations natively. The effort parameter provides a trade-off between encoding speed and compression ratio.
参数
- -q _N_, --quality=_N_
- Quality setting from 1 to 100. 100 is mathematically lossless. Default is 90.
- -d _N_, --distance=_N_
- Target visual distance (0=lossless, 1.0=visually lossless, higher means more compression). Overrides quality.
- -e _N_, --effort=_N_
- Encoder effort level from 1 to 9. Higher values produce smaller files but encode slower. Default is 7.
- --lossless_jpeg=_N_
- When encoding JPEG input, 1 preserves the original JPEG data for bit-exact reconstruction.
- -j, --jpeg_transcode
- Lossless JPEG transcode mode (shortcut for --lossless_jpeg=1).
- --num_threads=_N_
- Number of threads to use. 0 means use all available cores.
- --progressive
- Enable progressive decoding for the output file.
- --premultiply=_N_
- Premultiply alpha channel (0=no, 1=yes, -1=auto).
- -h, --help
- Display help information and exit.
- -v, --verbose
- Enable verbose output.
FAQ
What is the cjxl command used for?
cjxl is the reference encoder for JPEG XL, a next-generation image format designed to replace both JPEG and PNG. It is part of the libjxl project maintained by the JPEG committee. JPEG XL offers superior compression compared to legacy formats, supporting both lossy and lossless modes. A unique feature is the ability to losslessly transcode existing JPEG files, reducing their size by approximately 20% while allowing perfect reconstruction of the original JPEG. The encoder supports a wide range of input formats including PNG, APNG, GIF, JPEG, PPM, and PFM. It handles high bit depths, HDR content, and animations natively. The effort parameter provides a trade-off between encoding speed and compression ratio.
How do I run a basic cjxl example?
Run `cjxl [input.png] [output.jxl]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -q _N_, --quality=_N_ do in cjxl?
Quality setting from 1 to 100. 100 is mathematically lossless. Default is 90.