Scroll to navigation

CJXL(1) User Commands CJXL(1)

NAME

cjxl - compress images to JPEG XL

SYNOPSIS

cjxl [options...] input [output.jxl]

DESCRIPTION

cjxl compresses an image or animation to the JPEG XL format. It is intended to spare users the trouble of determining a set of optimal parameters for each individual image. Instead, for a given target quality, it should provide consistent visual results across various kinds of images. The defaults have been chosen to be sensible, so that the following commands should give satisfactory results in most cases:

cjxl input.png output.jxl
cjxl input.jpg output.jxl
cjxl input.gif output.jxl

OPTIONS

-h, --help

Displays the options that cjxl supports. On its own, it will only show basic options. It can be combined with -v or -v -v to show increasingly advanced options as well.

-v, --verbose

Increases verbosity. Can be repeated to increase it further, and also applies to --help.

-d distance, --distance=distance

The preferred way to specify quality. It is specified in multiples of a just-noticeable difference. That is, -d 0 is mathematically lossless, -d 1 should be visually lossless, and higher distances yield denser and denser files with lower and lower fidelity. Lossy sources such as JPEG and GIF files are compressed losslessly by default, and in the case of JPEG files specifically, the original JPEG can then be reconstructed bit-for-bit. For lossless sources, -d 1 is the default.

-q quality, --quality=quality

Alternative way to indicate the desired quality. 100 is lossless and lower values yield smaller files. There is no lower bound to this quality parameter, but positive values should approximately match the quality setting of libjpeg.

-e effort, --effort=effort

Controls the amount of effort that goes into producing an “optimal” file in terms of quality/size. That is to say, all other parameters being equal, a higher effort should yield a file that is at least as dense and possibly denser, and with at least as high and possibly higher quality.

Recognized effort settings, from fastest to slowest, are:

•1 or “lightning”

•2 or “thunder”

•3 or “falcon”

•4 or “cheetah”

•5 or “hare”

•6 or “wombat”

•7 or “squirrel” (default)

•8 or “kitten”

•9 or “tortoise”

EXAMPLES

# Compress a PNG file to a high-quality JPEG XL version.
$ cjxl input.png output.jxl
# Compress it at a slightly lower quality, appropriate for web use.
$ cjxl -d 2 input.png output.jxl
# Compress it losslessly. These are equivalent.
$ cjxl -d 0   input.png lossless.jxl
$ cjxl -q 100 input.png lossless.jxl
# Compress a JPEG file losslessly.
$ cjxl input.jpeg lossless-jpeg.jxl

SEE ALSO

djxl(1)

Debian manual

The following additional man page generate from help2man --help-option="--help --quiet -v -v -v -v" cjxl

NAME

cjxl - manual page for cjxl 0.11.2

SYNOPSIS

cjxl INPUT OUTPUT [OPTIONS...]

DESCRIPTION

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 (!).

Advanced options:

-a A_DISTANCE, --alpha_distance=A_DISTANCE

Target visual distance for the alpha channel, lower = higher quality. 0.0 = mathematically lossless. 1.0 = visually lossless. Default is 0. Recommended range: 0.5 .. 3.0. Allowed range: 0.0 ... 25.0.

-p, --progressive

Enable (more) progressive/responsive decoding.

--group_order=0|1

Order in which 256x256 groups are stored in the codestream for progressive rendering. 0 = scanline order, 1 = center-first order. Default: 0.

--container=0|1

0 = Avoid the container format unless it is needed (default) 1 = Force using the container format even if it is not needed.

--compress_boxes=0|1

Disable/enable Brotli compression for metadata boxes. Default is 1 (enabled).

--brotli_effort=B_EFFORT

Brotli effort setting. Range: 0 .. 11. Default: 9. Higher number is more effort (slower).

-m 0|1, --modular=0|1

Use modular mode (default = encoder chooses, 0 = enforce VarDCT, 1 = enforce modular mode).

-j 0|1, --lossless_jpeg=0|1

If the input is JPEG, losslessly transcode JPEG, rather than using reencode pixels. Default is 1 (losslessly transcode)

--num_threads=N

Number of worker threads (-1 == use machine default, 0 == do not use multithreading).

--photon_noise_iso=ISO_FILM_SPEED

Adds noise to the image emulating photographic film or sensor noise. Higher number = grainier image, e.g. 100 gives a low amount of noise, 3200 gives a lot of noise. Default is 0.

--intensity_target=N

Upper bound on the intensity level present in the image, in nits. Default is 0, which means 'choose a sensible default value based on the color encoding.

-x key=value, --dec-hints=key=value

This is useful for 'raw' formats like PPM that cannot store colorspace information and metadata, or to strip or modify metadata in formats that do. The key 'color_space' indicates an enumerated ColorEncoding, for example:

-x color_space=RGB_D65_SRG_Per_SRG is sRGB with perceptual rendering intent

-x color_space=RGB_D65_202_Rel_PeQ is Rec.2100 PQ with relative rendering intent

Shorthands: sRGB, DisplayP3, Rec2100PQ, Rec2100HLG The key 'icc_pathname' refers to a binary file containing an ICC profile. The keys 'exif', 'xmp', and 'jumbf' refer to a binary file containing metadata; existing metadata of the same type will be overwritten. Specific metadata can be stripped using e.g. -x strip=exif. Stripping metadata when losslessly recompression JPEGs only works without reconstruction, hence `--allow_jpeg_reconstruction=0` must be passed in this case.

Expert options:

--allow_jpeg_reconstruction=0|1

If --lossless_jpeg=1, store JPEG reconstruction metadata in the JPEG XL container. This allows reconstruction of the JPEG codestream. Default: 1.

--codestream_level=K

The codestream level. Either `-1`, `5` or `10`.

--faster_decoding=0|1|2|3|4

0 = default, higher values improve decode speed at the expense of quality or density.

--premultiply=-1|0|1

Force premultiplied (associated) alpha.

--keep_invisible=0|1

disable/enable preserving color of invisible pixels (default: 1 if lossless, 0 if lossy).

--center_x=-1..XSIZE

Determines the horizontal position of center for the center-first group order. Default -1 means 'middle of the image', values [0..xsize) set this to a particular coordinate.

--center_y=-1..YSIZE

Determines the vertical position of center for the center-first group order. Default -1 means 'middle of the image', values [0..ysize) set this to a particular coordinate.

--progressive_ac

Use the progressive mode for AC.

--qprogressive_ac

Use the progressive mode for AC with shift quantization.

--progressive_dc=num_dc_frames

Progressive-DC setting. Valid values are: -1, 0, 1, 2.

--resampling=-1|1|2|4|8

Resampling for color channels. Default of -1 applies resampling only for very low quality. 1 = downsampling (1x1), 2 = 2x2 downsampling, 4 = 4x4 downsampling, 8 = 8x8 downsampling.

--ec_resampling=-1|1|2|4|8

Resampling for extra channels. Same as --resampling but for extra channels like alpha.

--already_downsampled

Do not downsample before encoding, but still signal that the decoder should upsample.

--upsampling_mode=-1|0|1

Upsampling mode the decoder should use. Mostly useful in combination with --already_downsampled. Value -1 means default (non-separable upsampling), 0 means nearest neighbor (useful for pixel art)

--epf=-1|0|1|2|3

Edge preserving filter level, 0-3. Default -1 means encoder chooses, 0-3 set a strength.

--gaborish=0|1

Force disable/enable the gaborish filter. Default is 'encoder chooses'

--override_bitdepth=BITDEPTH

Default is zero (use the input image bit depth); if nonzero, override the bit depth

Options for experimentation / benchmarking:

--noise=0|1

Force disable/enable adaptive noise generation (experimental). Default is 'encoder chooses'

--jpeg_reconstruction_cfl=0|1

Enable/disable chroma-from-luma (CFL) for lossless JPEG reconstruction.

--num_reps=N

How many times to compress. (For benchmarking).

--streaming_input

Enable streaming processing of the input file (works only for PPM and PGM input files).

--streaming_output

Enable incremental writing of the output file.

--disable_output

No output file will be written (for benchmarking)

--dots=0|1

Force disable/enable dots generation. (not provided = default, 0 = disable, 1 = enable).

--patches=0|1

Force disable/enable patches generation. (not provided = default, 0 = disable, 1 = enable).

--frame_indexing=INDICES

INDICES is of the form '^(0*|1[01]*)'. The i-th position indicates whether the i-th frame will be indexed in the frame index box.

--allow_expert_options

Allow specifying advanced options; this allows setting effort to 11, for somewhat better lossless compression at the cost of a massive speed hit.

--disable_perceptual_optimizations

Disable perceptual optimizations

Modular mode options:

-I PERCENT, --iterations=PERCENT

Percentage of pixels used to learn MA trees. Higher values use more encoder memory and can result in better compression. Default of -1 means the encoder chooses. Zero means no MA trees are used.

-C K, --modular_colorspace=K

Color transform: -1 = default (try several per group, depending on effort), 0 = RGB (none), 1-41 = fixed RCT (6 = YCoCg).

-g K, --modular_group_size=K

Group size: -1 = default (let the encoder choose), 0 = 128x128, 1 = 256x256, 2 = 512x512, 3 = 1024x1024.

-P K, --modular_predictor=K

Predictor(s) to use: 0=zero, 1=left, 2=top, 3=avg0, 4=select, 5=gradient, 6=weighted, 7=topright, 8=topleft, 9=leftleft, 10=avg1, 11=avg2, 12=avg3, 13=toptop predictive average, 14=mix 5 and 6, 15=mix everything. Default is 14 at effort < 9 and 15 at effort 9-10.

-E K, --modular_nb_prev_channels=K

Number of extra (previous-channel) MA tree properties to use.

--modular_palette_colors=K

Use palette if number of colors is smaller than or equal to this.

--modular_lossy_palette

Use delta palette in a lossy way; it is recommended to also set --modular_palette_colors=0 with this option to use the default palette only.

-X PERCENT, --pre-compact=PERCENT

Use global channel palette if the number of sample values is smaller than this percentage of the nominal range.

-Y PERCENT, --post-compact=PERCENT

Use local (per-group) channel palette if the number of sample values is smaller than this percentage of the nominal range.

-R K, --responsive=K

Do the Squeeze transform, 0=false, 1=true (default: 1 if lossy, 0 if lossless)

-h, --help

Prints this help message. All options are shown above.
August 2026 cjxl 0.11.2