image-formats-comparison
Hit the space bar to toggle between images. Click on the image (or press any other key) to go back to mouse mode.
Notes
Each image size is targeting a fraction of the default JPEG XL compressed size for the image. The Large size is 1/1, the Medium size is 1/2, the Small size is 1/3, and the Tiny size is 1/4.
The results from JPEG XL are complicated, because the quality setting actually dynamically chooses between normal mode and "modular" mode, so you're seeing two different modes of operation depending on what the quality level is. There's some chance that this behavior isn't monotonic, but it should be okay at high quality levels and it's better than the alternative (which was previously only using the normal mode).
This page is based on Xiph.org's Daala comparison page. Originally developed by xooyoozoo. This version is a fork of WyohKnott's improved version with additional updates and modifications (detailed below).
A list of sources for the images can be found in this text file.
Last updated: April 2024.
Changes vs. WyohKnott
- Instead of using the original Daala test images, which are 4:2:0 subsampled, I recreated the image set from the original high-res sources, downscaling to the same sized source images as the Daala set, but not subsampled (4:4:4). This fixes this bug.
- I wrote my own script for generating the comparison images which uses a binary search to quickly find the quality level that generates the image with the closest file size to the target. You can find that here: here. This fixes this issue.
- All images that can't be rendered by the browser are now served as PNGs, instead of trying (in some cases) to decode with Javascript. The images were heavily compressed (losslessly) to take up less space, and this requires less decoding power on the viewer end. This change fixes this bug and also this one.
- The AVIF images are generated with a bit depth of 10. Reportedly, AV1 suffers from problems with the quantization that results in banding at bit depth 8. The improvement was not as significant as I have seen reported elsewhere; we might return to 8 bit in the future after further testing. Banding did seem to improve a little, but details seem slightly worse.
- A number of codecs from the previous version were dropped. I might accept patches to add these or other codecs.
- Daala: not a common codec, and most effort is now on AV1 / AVIF.
- KDU (JPEG2000): dropped because it crashes when given files with certain characters in the path.
- OpenJpeg (JPEG2000): extremely low quality, not worth the effort.
- PIK: dropped because I couldn't get it running on my computer; I think it might require newer CPU features. Many of its features have been subsumed into JPEG XL.
- VP9: like Daala, there's not much interest in VP9 as an image codec any more. Look at AVIF instead.
- WebP: dropped because it doesn't support unsubsampled images, making it a bad candidate for a high quality photography codec. All the codecs shown here are operating in their non-subsampled modes.
- The legacy BPG codec was replaced with the modern HEIF, which uses the same underlying video codec (H.265).
- JPEG XL was added to the comparison.
- jpegli was added to the comparison.
- All codecs were updated to their latest available releases, see below. This fixes this issue.
- I fixed a bug where the settings weren't restored from the URL when refreshing or sharing a link.
- I fixed a bug that caused images to frequently have incorrect bits / pixel calculations.
- I completed a partial rewrite of the canvas code making the comparison tool much faster, and fixed a bug where using a hidden canvas to resize the image would result in incorrect colors on some browsers. As part of this, I removed the Lanczos resizing feature in favor of integer only (nearest neigbor) resizing, which gives a more accurate presentation of the codecs.
Versions and Commands
AV1 (avifenc 1.0.4 + aom v3.8.2):
avifenc --depth 10 --yuv 444 --range full --speed 0 -c aom --min {quantizer} --max {quantizer} {input.png} {output.avif}
FLIF (FLIF 0.4):
flif -E 95 -Q {quality} {input.png} {output.flif}
HEIF (libheif 1.17.6):
heif-enc -p chroma=444 -p x265:p=veryslow -q {quality} -o {output.heif} {input.png}
jpegli (libjxl 0.10.2):
cjpegli --chroma_resampling=444 -d {quantizer} {input.png} {output.jpg}
JPEGXL (libjxl 0.10.2):
cjxl --resampling 1 -e 9 -d {quantizer} {input.png} {output.jxl}
JPEGXR (jxrlib 0.2.4):
JxrEncApp -d 3 -q {quality} -o {output.jxr} -i {input.ppm}
MozJPEG (mozjpeg 4.1.5):
cjpeg -sample 1x1 -quality {quality} -outfile {output.jpg} {input.png}