Using Saliency in progressive JPEG XL images
opensource.googleblog.com
opensource.googleblog.com
My understanding is also that you can also use the progressive nature to have 1 "high res" version, and potentially render different sizes for different connections, and do some interesting things. For example, I believe you could (in principal) do something like stop loading after 1s so long as a minimum size level was achieved) - to make things fast on all devices, but only the quality would vary. So if you are on a 4k monitor and gigabit download? You can get massive images. On a 3g phone? Get the basics.
It's a really great feature, and does seem like it would likely have the most real world impact on actual website perceived performance.
At this point I don't really see a reason for AVIF, hardware accelerated decoding could be a benefit, but AFAIK there's no device supporting it.
Oh, and Apple might be less hostile to it, because it's not based on an "anti-MPEG" video codec.
For still images though, I don't really see any major advantage of AVIF over JXL except AVIF being a bit older and already enabled by default in Chrome. I do see several advantages of JXL over AVIF though.
So the way I see it, the future is:
AVIF instead of GIF (and APNG and animated WebP)
JPEG XL instead of JPEG (and PNG and still WebP)
Disclaimer: I am probably biased since I am a jxl dev. Please do your own independent evaluation (and feel free to share your opinions/conclusions with me).
With baseline jpeg, you can blit the decoded blocks to screen directly and forget about it.
For progressive, you have to buffer the whole image (in DCT format!) and do the idct / color-space conversion on all passes.
By default JPEG XL's progressive uses only two scans, 8x8 DC, and the transforms in the second pass using a 256x256 tiles in encode-time chosen priority order. This choise allows JPEG XL to do only one round of DCTs even in the progressive case. The 8x8 DC is interpolated using cheaper methods.
Because of the design choices, every JPEG XL image is guaranteed to be at least minimally progressive in the same manner, i.e., 8x8 DC first. Having a guarantee will make it more rewarding for system designers to focus on extracting some user-experience benefit from that feature.
Such as time spent networking?
Imagine a file format that says "Byte-ranges 0-n will give you the image for a resolution of 640x480*. Bytes n+1 to m will give you the rest of the pixels for a resolution of 1440x1080, bytes m+1 to the end will give you the pixels you need to add to the 1080p version to get a 2160p version".
So the browser would decide what it needs and just requests the file up to that byte...
* The low-res 640x480 version might be all the browser needs if the person who designed the web page just wants the image e.g. as a small headline image in a news site column that is 640px wide
Safari chooses not to show intermediate results, but they are available with Chrome and Firefox.
The impact of progression on user experience is a complex question. It is for minimizing user experienced latency vs. (over)activating preattentive processing by images changing on the screen. Last year, Moritz Firsching (also the author of the blog post in question) made several improvements to the progression of traditional JPEG (libjpeg-turbo, Chrome, Firefox). Those changes -- in my opinion -- dramatically reduce the flicker and poor renderings that could occur from traditional JPEG progression, making progressive JPEGs more attractive overall.
https://news.ycombinator.com/item?id=27577328
Chrome status: behind a flag `enable-jxl`
FireFox status: only in Nightly and behind a flag `image.jxl.enabled`
Edge status: behind a runtime flag `--enable-features=JXL`
> image format support depends on OS library support, rather than anything in WebKit. [...] to be clear, Apple’s OSes do not currently support JPEG XL.
[1] https://blog.twitter.com/engineering/en_us/topics/infrastruc...
[2] https://www.reportr.world/news/twitter-drops-image-cropping-...
Again Image / Video / Audio Codec Support on Safari requires OS update. Unless this is on their agenda for iOS 16 and next macOS, which I doubt, it will likely be a few years before support of it becomes widely available.
And whether it loads faster or slower depends on your connection. But yes it hurts to not get the smoothness benefits.
Definitely smaller than I thought I recalled, and WASM bytes are no dearer than image bytes, though JS bytes are much more expensive, so it’s closer to just the more expensive decoding of the actual images that’ll bite you. Plus the not-integrated loading experience, of course.
Hopefully JXL doesn't become yet another image format (927)... some features of it are incredible. For example, you can have mixed lossless/lossy content in one image. No longer will you need to choose between a lossy or lossless format: the encoder would intelligently segment the image.
What's the advantage of that? If I'm dissatisfied with the compression quality in some areas, I can tweak the quality parameter already.
As far as I understand it, the synthetic mode compresses better for (as you can guess) synthetic content. So if you're encoding a mixed content screenshot, you'll get better quality and size by encoding the photos and UI separately.
Previous HN discussion https://news.ycombinator.com/item?id=21612708