Introduction
JPEG XL is a raster image format standardised by the JPEG committee as ISO/IEC 18181. It grew out of Google's PIK and Cloudinary's FUIF formats. It handles both lossy and lossless compression, alpha, high bit depths, HDR, animation and very large images.
One feature sets it apart: an existing JPEG file can be repacked as JPEG XL without loss, making it smaller, and the original JPEG can be rebuilt from it bit for bit.
Structure
A JPEG XL file is either a bare codestream or a codestream wrapped in a box
container. A bare codestream starts with the two bytes FF 0A. The
container starts with the 12-byte box 00 00 00 0C 4A 58 4C 20 0D 0A 87 0A
(a box of type JXL ), followed by an ftyp box and further
boxes for the codestream, Exif and XMP metadata, and the data needed to rebuild a
repacked JPEG.
The codestream holds an image header with the size and colour settings, then one or more frames. Each frame is split into groups that can be decoded in parallel.
In this reference
- Container – the signature, ftyp, level, codestream, metadata and Brotli boxes, and the level 5 limits
- Codestream headers – how fields are coded, the size header, image metadata, extra channels and colour encoding
- Frames – the frame header, blending, passes, restoration filters, the table of contents and the coding modes
Not described
JPEG XL is defined by ISO/IEC 18181-1 and -2, which are paid standards and were not read. The pages follow the libjxl source (headers, field coding, frame header, TOC) and its format overview.
Known, not yet covered
- Reference: not covered at all: entropy coding (ANS, prefix codes, LZ77, hybrid integers, context clustering), the modular tree and transform parameters, dequantisation tables, the XYB maths, patches, splines and noise syntax, and the JPEG reconstruction data format. All are in ISO/IEC 18181-1 and in libjxl’s source (codestream, frames).
- Reference: stated from memory of libjxl and not re-read: the name-length distribution; where
CustomTransformDatasits afterImageMetadata; ICC stream coding; the order of the three chroma subsampling modes; the TOC entry distribution, entry count formula and permutation coding; the AC strategy and modular predictor numbering; the default intensity target 255, at most 11 passes and 8 EPF sharpness entries. - Reference: the default level 5 when
jxllis absent, which boxesbrobmay not wrap, the byte layouts ofjxliandjbrd, and the level 10 limits in full (container). - Viewer: there is no JPEG XL plugin yet; decoding needs the entropy coder and transforms above.
Links
Software
- GIMP – free image editor that opens and exports JPEG XL (Windows, macOS, Linux)
- Krita – free painting program that opens and saves JPEG XL (Windows, macOS, Linux)
- Safari – Apple’s web browser, which displays JPEG XL (macOS, iOS)
- XnView MP – image viewer and batch converter (Windows, macOS, Linux)
- ImageMagick – command-line tools that convert to and from JPEG XL (Windows, macOS, Linux)
Developers
- libjxl – the reference library, with the
cjxlanddjxltools (C++)
Reference
- JPEG XL – the JPEG committee's overview of the standard