Hacker News new | ask | show | jobs
by computerbuster 52 days ago
I wrote "The Case Against JPEG XL". I still don't understand why this is a valuable addition to the Web, to be honest.

1. Lossy: AVIF is vastly more efficient at any fidelity target with reasonably modern encoders (libaom, SVT-AV1). Even proprietary WebP encoders are more efficient than libjxl. More efficient meaning better quality at the same size. This is provable even beyond modern metrics.

2. Lossless: JPEG XL is ~10-13% better than WebP here, but can be >6x slower to decode. What is the point of saving 10% bits when the client pays for it? There are lossless codecs more efficient than both that are faster to decode than both, too.

3. JPEG Recompression: Same deal, the increased decode time often erases the time-to-display gains (even on modern devices) - not just me either, this was proved empirically in the previous HN thread on a Pixel 9 Pro.

4. AVIF can have as many progressive decode passes as you like, and they aren't just "layers", they actually work together.

There are strengths, like 32-bit float precision and support for a lot of layers. I'm just lost on what the criteria for including a new codec in the Web is at this point. Google was heavily involved in JXL's development so I understand their incentives exist, and the "all-in-one" codec argument, but other than that, I'm a bit lost.

4 comments

It's a philosophical difference I suspect. To quote from your site:

"I believe Web codecs should be purpose-built, efficient, and narrowly scoped to the needs of the Web.... [JPEG XL] is meant to be everything to everyone... Not to mention an additional compatibility headache now exists for anyone just trying to download an image from the Internet and use it somewhere"

Browsers aren't trying to be narrowly scoped anymore, nor made just for the web (Rust and LLMs must have improved their confidence regarding security). Other usecases (like PDFs and cameras) clearly benefit from JPEG XL. Once support was added, it was easy to just turn on for the web. After all, they need to consider the opposite case where someone creates a jxl image and tries to upload it to the Internet. They might even think that having a format that is everything to everyone is useful and eventually the (en)decorders will improve.

Exactly, the answer to "why should browsers support JXL?" is the same as the answer to "why do browsers ship a PDF viewer?".
1. Not true before modern AV1 encoder got major improvements in the past 3 years. There is no reason why JPEG-XL can't be improved in the low bpp range. JPEG itself got improvement 20 years after its initial introduction. Not to mention the last time I check, JPEG XL is still better at high end fidelity.

2. JPEG XL lossless can be 10-13% or in some cases up to 50% better. Of course WebP could also be better in some cases. And again, JPEG-XL potential is far fully optimised. Both in encoder and decoder.

On another note, the AOM camp should really have played the AV2 card suggesting it to be better.

I talk about this in the article, but while I agree JXL can get a lot better (prob as good as current libaom) its coding tools are much harder to use – e.g. splines vs dir pred. And I think the sometimes better sometimes worse lossless argument is still not really a super compelling case?
The goal is to do everything good enough, and if possible almost as good as purpose-built. So yes, every other format is better when looking at specifics. But JPEG XL's goal is the best average.
Yeah, F this. From now on, I'm going to stick to GIF.