Scroll to navigation

DJXL(1)   DJXL(1)

NAME

djxl - decompress JPEG XL images

SYNOPSIS

djxl [options...] input.jxl [output]

DESCRIPTION

djxl decompresses a JPEG XL image or animation. The output format is determined by the extension of the output file, which can be .png, .jpg, .ppm, .pfm. If the JPEG XL input file contains an animation, multiple output files will be produced, with names of the form "output-framenumber.ext".

OPTIONS

-V, --version

Print version number and exit

--num_reps=N

Sets the number of times to decompress the image. Used for benchmarking, the default is 1.

--num_threads=N

Sets the number of threads to use. The default 0 value means the machine default.

--bits_per_sample=N

Sets the output bit depth. The default 0 value means the original (input) bit depth.

--display_nits=0.3-250

If set to a non-zero value, tone maps the image the given peak display luminance.

--color_space=RGB_D65_SRG_Rel_Lin

Defaults to original (input) color space

-s N, --downsampling=N

If set and the input JXL stream is progressive and contains hints for target downsampling ratios, the decoder will skip any progressive passes that are not needed to produce a partially decoded image intended for this downsampling ratio.

--allow_partial_files

Allow decoding of truncated files.

-j, --pixels_to_jpeg

By default, if the input JPEG XL contains a recompressed JPEG file, djxl reconstructs the exact original JPEG file. This flag causes the decoder to instead decode the image to pixels and encode a new (lossy) JPEG. The output file if provided must be a .jpg or .jpeg file.

-q N, --jpeg_quality=N

Sets the JPEG output quality, default is 95. Setting an output quality implies --pixels_to_jpeg.

--norender_spotcolors Disables rendering spot colors.

--preview_out=FILENAME

If specified, writes the preview image to this file.

--icc_out=FILENAME

If specified, writes the ICC profile of the decoded image to this file.

--orig_icc_out=FILENAME

If specified, writes the ICC profile of the original image to this file. This can be different from the ICC profile of the decoded image if --color_space was specified, or if the image was XYB encoded and the color conversion to the original profile was not supported by the decoder.

--metadata_out=FILENAME

If specified, writes decoded metadata info to this file in JSON format. Used by the conformance test script

--print_read_bytes

Print total number of decoded bytes.

--quiet

Silence output (except for errors).

-h, --help

Displays the options that djxl supports.

EXAMPLES

# Decompress a JPEG XL file to PNG
$ djxl input.jxl output.png
# Reconstruct a losslessly-recompressed JPEG file
$ djxl lossless-jpeg.jxl reconstructed.jpeg

# Lossless compression

Lossless pixel compression only preserves the pixels losslessly, not the input bitstream. To check that the pixels are identical, one can do something like the following (if this says 0, then the maximum pixel error is 0, so it’s lossless):

# Lossless compression of PNG:
$ cjxl -d 0.0 input.png lossless.png
# Decompress a JPEG XL file to PNG
$ djxl lossless.jxl lossless.png
$ compare -metric pae input.png lossless.png null:
0 (0)

SEE ALSO

cjxl(1)

04/07/2024