JPEG XL (JXL): The Next-Generation Image Standard That Does Everything
JPEG XL (JXL) is an open-source image format developed by Google and Cloudinary, standardized as ISO/IEC 18181 in 2022. It is arguably the most technically comprehensive modern image format: it matches AVIF's compression at high quality, supports lossless recompression of existing JPEGs (enabling lossless JPEG transcoding), offers exceptionally fast decoding, supports 1-bit to 32-bit HDR, and handles animations. Despite its technical excellence, JPEG XL faces a challenging adoption situation: Chrome removed support in 2022 (later reversing course), and Safari is the only major browser with native support.
Core Design Goals
JPEG XL was designed with four explicit goals:
- Better than existing formats across all dimensions: Outperform JPEG, PNG, WebP, and GIF in all use cases
- Lossless JPEG transcoding: Convert existing JPEG files to JXL losslessly (and back), enabling format migration without quality loss
- Practical for image professionals: Supports color profiles, HDR, 1-bit to 32-bit depths, CMYK, multi-frame, and metadata
- Deployable everywhere: Fast encode/decode, progressive rendering, decent file sizes at high quality
Compression Technology
JPEG XL uses two completely different compression methods depending on the mode:
Lossy Mode (VarDCT)
For lossy compression, JXL uses VarDCT (Variable DCT Block Sizes):
- Adaptive quantization: Unlike JPEG's fixed 8×8 block DCT, VarDCT uses variable block sizes (from 2×2 up to 256×256) selected per-region. Smooth areas use large blocks; detail areas use small blocks.
- XYB color space: A custom color space derived from the human visual system, where X+Y, B, and a modified luminance channel correspond to the three cone types of human vision. More perceptually uniform than YCbCr.
- Butteraugli perceptual metric: JXL's encoder uses a psychovisual model during encoding to optimally allocate bits — spending more bits where the human eye is most sensitive.
- SIMD-optimized decoder: The JXL reference implementation (libjxl) uses AVX2/SSE4.2 SIMD instructions for very fast decoding — typically 2–4× faster than JPEG for equivalent quality.
Lossless Mode (Modular)
For lossless compression, JXL uses the Modular compression scheme:
- Prediction-based: Each channel (R, G, B, A) is predicted from previously decoded values using a set of predictors
- MA (Meta-Adaptive) trees: Decision trees that adaptively select the best predictor for each region of the image
- ANS entropy coding: Asymmetric Numeral Systems for efficient entropy coding of prediction residuals
Lossless JXL is typically 35% smaller than PNG for photographic content and competitive with WebP lossless.
JPEG Lossless Transcoding
The most unique JXL feature: lossless transcoding of existing JPEG files. JXL can store the original JPEG DCT coefficients plus a small overhead for JPEG metadata, resulting in:
- No quality loss (mathematically lossless roundtrip JPEG → JXL → JPEG)
- Typically 20% smaller than the original JPEG
- Enables migrating existing JPEG archives to JXL without quality degradation
# Losslessly transcode JPEG to JXL (preserves original JPEG recoverable)
cjxl --lossless_jpeg=1 input.jpg output.jxl
# Recover original JPEG from lossless JXL transcode
djxl output.jxl recovered.jpg
Progressive Decoding
JXL supports progressive decoding in a more sophisticated way than JPEG's progressive scan:
- DC pass: Shows a very low-resolution preview almost immediately
- AC passes: Incrementally adds detail in multiple refinement passes
- The image becomes usable at 1/8 or 1/16 of full data receipt — useful for slow connections where AVIF shows nothing until fully downloaded
Color Depth and HDR Support
| Feature | JXL | AVIF | WebP | JPEG |
|---|---|---|---|---|
| Max bit depth | 32-bit float | 12-bit | 8-bit | 8-bit |
| HDR | ✅ Full | ✅ Full | ❌ | ❌ |
| Wide color gamut | ✅ | ✅ | ❌ | ❌ |
| CMYK | ✅ | ❌ | ❌ | ✅ |
| Arbitrary channels | ✅ | ❌ | ❌ | ❌ |
| Scientific imaging | ✅ | ❌ | ❌ | ❌ |
The 32-bit float support and arbitrary channel count make JXL unique among image formats — it can store scientific data, medical imaging, and multi-spectral data that no other standard image format handles.
File Size Comparison
Compared to JPEG at equivalent visual quality (SSIM):
| Format | Size vs. JPEG | Encoding Speed | Decoding Speed |
|---|---|---|---|
| JPEG XL | -60% | Medium | Very Fast |
| AVIF | -50% | Very Slow | Medium |
| WebP | -30% | Fast | Fast |
| HEIC | -50% | Slow | Fast (HW) |
JXL achieves the best compression ratio of any modern image format at equivalent quality, while maintaining fast decoding speeds.
Encoding JXL
cjxl (libjxl reference encoder)
# Lossy encoding (quality 0=worst, 100=best, default 90)
cjxl --quality 80 input.jpg output.jxl
# Match AVIF quality (quality ~70 JXL ≈ quality 70 AVIF)
cjxl --quality 70 input.jpg output.jxl
# Lossless encoding
cjxl --lossless 1 input.png output_lossless.jxl
# Lossless JPEG transcoding (mathematically lossless)
cjxl --lossless_jpeg=1 input.jpg output_from_jpeg.jxl
# Progressive (for web streaming)
cjxl --progressive 1 --quality 80 input.jpg output_progressive.jxl
# Decoding JXL
djxl output.jxl decoded.png # or .jpg, .ppm, etc.
ffmpeg
# JXL via ffmpeg (requires libjxl support compiled in)
ffmpeg -i input.jpg -c:v libjxl -q:v 80 output.jxl
ImageMagick (7.1+)
convert input.jpg -quality 80 output.jxl
Browser Support Situation (2024)
| Browser | Status |
|---|---|
| Safari / iOS Safari | ✅ Native support (17+) |
| Chrome | ❌ Removed Aug 2022, flag removed 2023; working on re-enabling |
| Firefox | ❌ Behind flag (media.jxl.enabled=true in about:config) |
| Edge | ❌ Not supported (Chromium-based, follows Chrome) |
Chrome's removal of JPEG XL in August 2022 was highly controversial in the web standards community and generated significant backlash. The stated reason was insufficient ecosystem adoption and resource constraints. The format remains actively developed and specification-complete.
Practical implication: JPEG XL cannot currently be served directly to Chrome users without fallback. Use it for:
- Safari-specific delivery (iOS App Store apps, Apple ecosystem)
- Server-side storage (transcode to WebP/AVIF for delivery to non-Safari browsers)
- Image archives and lossless JPEG migration pipelines
JPEG XL vs. AVIF — When to Use Each
| Criterion | Choose JXL | Choose AVIF |
|---|---|---|
| Chrome support needed | ❌ | ✅ |
| Maximum compression | ✅ (slightly better) | ✅ (close) |
| Decoding speed | ✅ (faster) | Medium |
| Lossless JPEG migration | ✅ (unique feature) | ❌ |
| 32-bit/HDR/CMYK | ✅ | Limited |
| Progressive decoding | ✅ | ❌ |
| Animation (Safari) | ✅ | ❌ (Safari doesn't support animated AVIF) |
| Broad browser support | ❌ | ✅ |
Summary
JPEG XL is technically the most capable image format available — it outperforms AVIF in compression at high quality, adds lossless JPEG transcoding, achieves faster decoding, and supports HDR up to 32-bit float. Its limitation is browser adoption: Chrome's controversial decision to remove support has stalled web deployment. For professional image workflows, lossless JPEG archives, and Safari-targeted content, JXL is compelling. For broad web deployment today, AVIF with WebP fallback remains the practical choice. Monitor Chrome's JXL re-enabling status — if Chrome adds support, JXL could become the universal modern image format.
Related conversions
Most teams that read this guide convert images in one of these directions: