JPEG XL vs. AVIF for web use-cases
JPEG XL vs. AVIF for web use-cases
The comparison is more about who has had the most man-hours and megadollars put into encoders quality than about the inherent limitations about the format.
With that said, I use AVIF, but I do have what can be said to be an irrational preference for JXL.
Is it irrational to follow the collective "one format to rule them all" dream? Sure, the codec itself needs work, but seeing how long we've been stuck with the JPEG/PNG/GIF trio (even with better encoders like mozjpeg/jpegli or optipng/zopfli) with TIFF as a catch-all backup, getting the format right once and for all really matters.
I'm still weirded by the low amount of workforce in libjxl/jxl-rs; sure, too many cooks do ruin the broth, but too few too, in that domain.
In terms of picture quality for given size, AVIF has it solidly beat.
"We should use AVIF for most web images" is a different statement which I have no problem with.
I'm not sure this is the right conclusion to draw...
1) The author's pain point (use case) is hardware pricing - presuming that goes down (as either AI demands drops/and or production increases), this does not speak to a demand for size, instead, it is about doing more with less...
2) I'm not certain that the exabytes of demand (assuming it comes) will be from AVIF. Rather, if data is important, I think the demand will be a different format entirely (archives, for instance). Demand for more (quality) data might paradoxically call for less compression and less cpu-intensive qualities - uncompressed, raw data, for instance. If is faster and cheaper than bothering with complex algorithms, then simpler formats should be more prevalent.
Building on 1 and 2, a more capable image format, like JPEG-XL, becomes a more logical choice, not the one that can compress the best or is the smallest (in an exa-byte-as-the-norm world).
For arbitrary planes, AVIF calls them auxiliary images. Unless you mean encoding non-RGB data to start with like how DNG uses JPEG-XL. At which point you're outside the scope of any standard interpretation of JPEG-XL data.
Huh?
JpegXL is the only widely supported format (once it comes to the various browser as is planned) that can store true HDR linear images in floating point (fp16 and fp32) formats.
AVIF can only do 10 bit integer ranges, sure that HDR compared to 8bit but it is not sufficient for useful extended range color spaces.
Also AVIF supports up to 12 bits.
I added support to ThreeJS last month because Chrome supports linear Jpeg XL with the experimental flag on. The other browsers are expected to follow:
Just about anything is better than jpeg these days.
Just like you can assume most PNGs to be lossless (despite supporting pallettes, which pngquant uses to "compress" them) and non-animated (despite APNG being over 22 years old), you can assume most AVIF and WebP images are lossy. Same with JXL. HEIF requires a bit of special care (it's only produced by devices with HDR support so your pipeline needs to fit that) but that's pretty much it.
You may get surprised by an accidental, huge lossless AVIF/WebP/HEIF file, but most sources where you can even get these files are all lossy. Unless you recompress your photo library yourself, of course, but then you have full control over the entire process and can decide whether or not you want lossy or lossless.