JPEG XL versus AVIF — matched HDR
111 demo photographs · direct HDR, no gain map · 2048-pixel maximum long edge · identical resizing and sharpening
Compare in Chrome on your Mac first: our previous tests found Safari HDR banding that can obscure encoding differences. Both are direct HDR encodings. A lossless JPEG XL reference preserves the common prepared pixels.
Loading…
File sizes across the complete set
| Setting | Average | Median | Total |
|---|---|---|---|
| Lossless reference | 11,226 KB | 10,997 KB | 1,216.9 MB |
| JPEG XL distance 2 | 299 KB | 294 KB | 32.5 MB |
| AVIF Q65 | 210 KB | 191 KB | 22.7 MB |
Method and verification
Both lossy encodings and the lossless reference start from exactly the same resized and sharpened HDR pixels. The source gamut (P3 or BT.2020) and PQ transfer are retained. Resizing uses the established floating-point per-channel Lanczos routine in PQ space, rounded to 16-bit. The established luminance-only sharpening is applied once (amount 0.45, sigma 0.7, limit 0.15) before encoding either format. No added dither. Alpha edges, where present, are composited over black in linear light by the existing master loader.
JPEG XL distance settings are not equivalent to AVIF quality numbers. Lower distance targets higher fidelity. Lossless is relative to the resized input, not the original full-resolution master. Lossless pixels were verified exactly; each source file hash was checked before and after encoding. Original files and production galleries were not changed.
Sizes use KB = 1024 bytes and MB = 1024² bytes. The CSV includes combined encoding and verification time, not a controlled speed benchmark. JPEG XL: libjxl distance 2, effort 5, 16-bit input. AVIF: libaom Q65, speed 4, 10-bit 4:4:4, full range, matching the existing AVIF depth/chroma/speed. Thus the prepared input is identical, but encoded precision and compression tools differ. No gain maps. This is a practical recipe comparison, not a comparison at matched file size or encoding time.