JPEG XL (JXL): The Next-Generation Image Format
What Is JPEG XL?
JPEG XL (extension .jxl) is a royalty-free, open image coding standard developed by the Joint Photographic Experts Group — the same body that created the original JPEG in 1992. Standardized as ISO/IEC 18181 between 2021 and 2022, JPEG XL was designed from the ground up to be a universal successor to both JPEG (for photographs) and PNG (for lossless and transparency), while also competing with modern formats like WebP, AVIF, and HEIC.
Its two defining properties:
- Lossless JPEG recompression: An existing JPEG can be losslessly transcoded to JXL and reduced by roughly 20% in size, then fully reconstructed to the original bit-for-bit JPEG bytes. No other format offers this.
- State-of-the-art compression: At equivalent quality to JPEG, JXL images are typically 30–60% smaller; at equivalent quality to PNG lossless, they are 15–35% smaller.
Technical Architecture
Modular Encoding
JXL uses a sophisticated modular prediction system (VarDCT mode for lossy, Modular mode for lossless) as its core coding engine.
VarDCT mode (lossy):
- Adaptive block sizes from 8×8 to 256×256 (unlike JPEG's fixed 8×8)
- Sophisticated edge-preserving quantization with adaptive Lagrange multipliers
- XYB color space (perceptually uniform, derived from LMS cone responses) that allows more bits to go where the human eye is sensitive
- Patches prediction, noise synthesis, and spline rendering for synthetic content
- Progressive decoding: low-resolution preview from first bytes, refined as more data arrives
Modular mode (lossless and near-lossless):
- MA (Meta-Adaptive) tree predictor using local image structure
- Supports all bit depths: 1-bit line art through 32-bit HDR float
- Delta palette for efficient encoding of graphics and UI screenshots
Bit Depth and Color
JXL natively handles:
- 1 to 32 bits per channel — binary, 8-bit, 10-bit, 12-bit, 16-bit, 32-bit float
- Up to 4099 channels — wide-gamut, spectral imaging, multi-pass rendering layers
- HDR and wide-gamut: full support for Rec. 2020, Display P3, Pro Photo RGB, and custom ICC profiles
- Alpha transparency: full support, including premultiplied alpha and 16-bit alpha
Animation and Sequences
JXL supports multi-frame animation with:
- Per-frame timing with millisecond precision
- Blending modes (replace, alpha composite, multiply, etc.)
- Frame reuse / delta frames for efficient animated content
- Cropping regions per frame (store only changed pixels)
This positions JXL as a drop-in animated PNG (APNG) and GIF replacement with far superior compression.
Metadata
JXL embeds metadata using the same container as ISOBMFF:
- Exif — camera metadata (shutter speed, GPS, orientation)
- XMP — extensible metadata platform (copyright, keywords, color profiles)
- ICC profiles — embedded color management (mandatory for HDR content)
- JUMBF boxes — extensible JSON/binary metadata for C2PA provenance
JPEG Transcoding: The Killer Feature
No other modern image format can claim this: feed a .jpg file to the cjxl encoder in "lossless JPEG recompression" mode, and you get a .jxl file that:
- Is ~20% smaller than the original JPEG
- Can be decoded back to the exact original JPEG (same bytes, same EXIF, same chroma subsampling) using
djxl --jpeg
This is possible because JXL stores the original DCT coefficients, quantization tables, and Huffman codes in a more efficient entropy-coded representation, without applying any new lossy transforms.
# Lossless JPEG → JXL (stores original DCT data)
cjxl input.jpg output.jxl --lossless_jpeg=1
# Restore the original JPEG bit-for-bit
djxl output.jxl restored.jpg --jpeg
# Lossy re-encode for maximum compression
cjxl input.jpg output.jxl -q 85 # quality 0–100 (like JPEG quality scale)
# Lossless PNG → JXL
cjxl input.png output.jxl -q 100
Compression Benchmarks
Typical file size at visually equivalent quality (vs. original JPEG at Q75):
| Format | Size ratio | Notes |
|---|---|---|
| JPEG (original) | 100% | Reference |
| WebP lossy | ~70% | No progressive, limited bit depth |
| AVIF | ~60–65% | Slow encode, no JPEG transcoding |
| JPEG XL | ~50–60% | Progressive, JPEG transcoding, HDR |
| HEIC | ~55–65% | Patent-encumbered, Apple-centric |
For lossless (vs. PNG):
- WebP lossless: ~70% of PNG
- AVIF lossless: ~75–80% of PNG (variable)
- JXL lossless: ~60–70% of PNG for photographs; ~80–90% for UI/screenshots (Modular mode's MA predictor isn't optimized for pixel-art palette graphics the way PNG is)
Browser Support Status
JXL has had a turbulent browser adoption path:
- Chrome: Added behind a flag in 2021, then removed in Chrome 110 (2023) pending a formal spec finalization. As of 2025, the Chromium team has indicated plans to re-add support — active development is ongoing.
- Firefox: Supported since Firefox 118 (2023) behind
image.jxl.enabledflag; Nightly enables by default. - Safari: Supported in Safari 17.0+ (macOS Sonoma, iOS 17) — fully shipped. This makes JXL the default format on Apple devices.
- Edge: No native support; follows Chromium.
The Safari shipping and Chrome's ongoing re-evaluation mean JXL is gaining real traction. For image delivery on the web today, serve JXL to Safari users and AVIF or WebP to Chrome/Firefox users.
Command-Line Tools
The reference implementation is libjxl (from the JPEG XL GitHub repository):
# Encode: JPEG → JXL (lossless JPEG recompression)
cjxl photo.jpg photo.jxl --lossless_jpeg=1
# Encode: PNG → JXL lossless
cjxl diagram.png diagram.jxl --lossless
# Encode: with effort level (1=fast, 9=slow+smaller)
cjxl photo.jpg photo.jxl -q 85 -e 7
# Decode to PNG
djxl photo.jxl photo.png
# Decode back to original JPEG
djxl photo.jxl photo.jpg --jpeg
# View metadata
jxlinfo photo.jxl
ImageMagick (7.1+), libvips, and FFmpeg (recent builds) also read/write JXL.
Use Cases Where JXL Excels
- Photography archives: lossless JPEG transcoding — archive millions of existing JPEGs with 20% less storage, no quality loss, full JPEG recovery
- HDR photography: 10/12/16-bit HDR images in Rec. 2020 or Display P3 with proper ICC profiles
- Professional print: 32-bit float channels, wide-gamut, CMYK-compatible profiles
- Animated content: better than APNG and WebP animated for high-quality animation
- Progressive delivery: low-quality preview visible after ~1% of bytes; progressively refined to full quality
- Scientific imaging: multi-channel spectral images, medical imaging, satellite imagery
Practical Tips
- Use quality 85–90 for web photography (JXL quality is not identical to JPEG quality — calibrate visually)
- Effort level 7 (
-e 7) gives the best size/speed trade-off for production encoding;-e 9is for archival - Always embed ICC profiles for HDR/wide-gamut content; browsers use them for correct color rendering
- For web delivery today: detect
Accept: image/jxlin request headers and serve JXL to Safari, AVIF/WebP to others - Progressive encoding is enabled by default for quality < 100 — no extra flag needed
- JPEG transcoding is the immediate killer use case for large JPEG archives even before browser support is universal
JPEG XL's combination of lossless JPEG transcoding, best-in-class compression, true HDR support, and progressive delivery makes it the most technically ambitious image format ever standardized — and with Safari already shipping support, its real-world deployment is already underway.
Related conversions
Most teams that read this guide convert images in one of these directions: