I think one overlooked aspect is that AVIF is container based. Meaning that once sites support, when AV2, AV3 etc. will come out, there won't be a need to go through another very difficult phase of sites adoption - it will still be AVIF just with newer codec inside, and it will be just up to browsers to catch up on newer versions and newer codecs will address technical needs as times goes.
JPEG XL doesn't have that benefit, while sites adoption is arguably a worse issue than browser adoption.
To demonstrate the point even for AVIF itself - it has been in the browsers for a while. Can you use it on common sites? Good luck if you can, even major sites like GitHub and GitLab have issues with it due to some site code depending on hardcoded list of known formats or other similar problems.
The container is useless. Files based on a newer codec won't display anyway.
ISO-BMFF container is bloated and needlessly complicated. AVIF decoders didn't even want to reuse existing MP4 libraries for it due to all the baggage it brings, and implemented their own minimal parsers.
AVIF would have been better off with a simple wrapper similar to RIFF/PNG or extending AV1's own OBU header (which for inexplicable reason gets its data duplicated inside the HEIF container and then implementations are required to verify that both copies agree!)
I hope AVIF will skip AV2. We don't need yet another almost-identical format to migrate to.
My guess: because the OP forgot that to decode AV2/AV3 it matters not that it is in an AVIF container, it matters that the display system (browser, etc.) actually have the codec available to it that can decode the new format (AV2/AV3/etc.).
With no codec for a new compression algorithm, it does not matter if the browser can read the container, you still see the "broken image" icon on your display.
> I think one overlooked aspect is that AVIF is container based.
Many other image formats are. AVIF uses HEIC, the same container that HEIF does.
> when AV2, AV3 etc. will come out, there won't be a need to go through another very difficult phase of sites adoption - it will still be AVIF just with newer codec inside, and it will be just up to browsers to catch up on newer versions and newer codecs will address technical needs as times goes.
Fingers crossed, but AV2-based AVIF specs have yet to be finalized, so who knows.
This doesn't make sense to me. There's enough content negotiation out there that AV2 will need a new content-type parameter. Feature detection is important to browsers.
It's not mandatory, and it would work without using it. The whole point is for forward compatibility support effect for sites which are very slow introducing these kind of changes.
AV1 is not necessarily a better codec for the web. It’s just that its encoders have been continuously improving while those of JPEG XL weren’t seeing much attention, so they fell behind. The format might be better overall, but we won’t know for sure until the encoders catch up.
AVIF is a lifesaver for animation with separate transparency layers so the transparency can change position frame by frame. The only other alternative is WebM which has Safari limitations.
Is there an advantage to this as a separate layer compared to just having an alpha channel baked into the image data itself? If not premultiplied then it would not affect the other channels either.
But the performance is so bad it isn't worth using. You're better off encoding a double height AV1 and mashing it together with WebGL https://jakearchibald.com/2024/video-with-transparency/. That's how bad the situation is.
> AVIF is basically the keyframe format of AV1 video, with a bunch of still-image-specific optimisations thrown in. Animated AVIF however, is pretty much just a repackaging of AV1 video. You can convert an AV1 MP4 to AVIF and back losslessly - it's just a container change. That's why it performs so much better, because it's built for motion.
So, is animated AVIF only keyframes / p-frames, where each frame is independent from the other? I was under that impression, uncertain if there are any other capabilities it might have (like only updating part of the canvas when only parts change, like GIF supports)
JPEG transcoding is one of the neatest features of JXL; there is so much existing jpeg out there. Eventually that may be unnecessary, but it's looking like this could already save a significant amount of space for photo archive backups for example.
The blog post is from 10 years ago. I'm sure it's much faster on modern hardware. I'd say that the main difference is that JPEG XL can be rendered directly in many applications, while Lepton files will have to be processed into JPEG out of your archives.
Jake's interest in F1 hasn't waned, which is good to see. I am presuming that picture of an Alpine/Renault at Goodwood is his 18Mb photo, but I could be wrong. Neither has his interest im image compression waned, which is also good to see. But why the move from Google to Firefox?
I am still on webp, thinking that I am on the bleeding edge in a world where artworkers are obsessed with pixels with JPG/PNG as the only formats they know, which is an advance on GIF.
Every browser advertises what formats it will accept and if it is in 'data-saving, low bandwidth mode', so I just configure the CDN to keep the names the same '.jpg' but to send the bestest format for the situation/browser, whether that be webp or AVIF, fetching super-high resolution files from the origin server, outputting them in 'retina' resolution with none of those 'picture' elements referencing half a dozen 'responsive' sizes.
In this way nobody has to care what image format is being served, and if it is deemed that everything is way too compressed, the CDN can be flushed of the cached images, quality increased, and cache rebuilt.
It looks like I will need to update my server configuration to use JPEG XL in the usual five years' time, given the lack of any revolutionary benefit.
I was at Google for 10 years, then went to Shopify for 2 years, but I missed the web. For most of the time I was at Google, it mostly did what was good for the web, rather than pushing Google's interests, but that started to change, which is one of things that led to me leaving. E.g. see what happened with the Prompt API.
I am always on Team Hamilton even though I appreciate that he is a little long in the tooth and doing the classic retirement act in a 'stupid red car'.
I am obsessed with SVG and image compression/delivery, and I would like it if you could introduce the concept of an 'SVG sampler' to the world. This is very much inspired by embroidery samplers from the times when women needed to sew.
The point of the sampler is to impress, so as to get the work in, however, it is also a reference, with stitches to copy for lettering, numbers, religious iconography, sock-darning, button-holes and whatever else needs to be repeated.
With an SVG sampler the idea is to use the whole SVG toolkit, filters, masks, clip paths, symbols, views, SMIL, CSS and everything else.
Sure this can be done in Inkscape, however, the goal of the SVG sampler is to make it human drawable. For example, the search icon is a circle and a line, which can be done in a 45Kb export from Illustrator, with the circle defined as a thousand points, specified to NASA numbers.
Or it can be done in ten lines or so of SVG primitives, with the circle and the line using simple two-digit integers. The former is not something that a mere mortal could draw, whereas the latter could be.
Clearly some paths do need to be complex and imported from elsewhere.
SVGOMG will be able to mash the 45Kb Illustrator export into a tenth the size, however, it will not be as concise or as human readable as the 'haiku of the SVG sampler symbol'.
The SVG sampler does not have to be web-optimised, it can max out the CPU for the PC to go full China Syndrome and melt its way through your desk. However, it could be forked, culled of CPU-eater show-stoppers, to just have the icons needed for the next project.
Another way of seeing the SVG sampler idea is 'SVG golf', where you want to strive for maximal 'use' clones, maximal human readability, yet also an insistence on detail such as light/dark mode currentColor things, animating pretty much everything and using the primitives rather than paths, even if the code is longererer according to SVGOMG.
I think that SVG falls within an awkward gap where artworkers don't care for the code with programmers also not caring for the code, because SVG is artworker stuff, not for programmers, right?
In a typical team workflow there is no scope for this to change, the frontend developer is obligated to use the 'assets' churned out by the art worker and the backend developer certainly doesn't care.
Hence, an SVG 'sampler' competition of sorts, with some acknowledgement, could help Firefox win over some developer mindset to FF. Already MDN has the de-facto best documentation for SVG, I probably have a dozen MDN tabs open right now, maybe with all of them on some type of FEconvolve type of feature.
For the sampler, the IDE rather than the graphics program is how it works. Anything with 'sodipodi' type of extra markup can be considered not worthy of being an SVG sampler. Really it has to be a mostly text-only thing, under version control, and not needing CodePen or other. To go with the SVG there needs to be a 'sampler.html' file to show the sampler symbols in 'inline mode' as well as CSS, the favicon and as shown as an 'image' element. Scripting is allowed, but really the goal is to keep everything in the SVG file, to not need huge amounts of extra files.
Ideally comments outside of 'title' and 'description' should not be needed, the author should be able to explain their own code, hence an emphasis on 'defs', sensible id names and descriptive ids.
Since F1 is your thing, you are welcome to give the SVG sampler idea a F1 inspired ethos to it. If you think of the FW14C with the active suspension and whatnot, or the F-duct, DAS and other wonders, then applied that design rigour to SVG, think how good it could be. Added marks for everything good looking, h...
I'm only casually following JPEG-XL and my impression from previous reading here on HN was that JPEG-XL was the best solution available for a wide variety of usecases, but it looks like numbers dont match that claim?
JPEG-XL is not the best solution if you want small low-quality images, to reduce your costs for hosting some Web site. AVIF seems appropriate for that goal.
JPEG-XL seems to be the best solution for storing and distributing high-quality images. For myself, I want high-quality images, so JPEG-XL is what matters, both for new images and for compressing old archives of JPEG images.
For a wide variety of usecases, not for every isolated usecase. Today, AVIF is better for showing people ads^W^W^W web content delivery. This article is titled “JPEG XL vs. AVIF for web use-cases”. The other article recently discussed¹ is subtitled “Investigating JPEG XL's place as a Web image codec” and ends:
> JPEG XL isn't useless; it is genuinely compelling technology for use cases beyond the Web.
AVIF ( or even AV1 itself ) has had massive increase in quality improvements over the past 6 years. JPEG XL was close to release in 2020 and finalised in 2021. A lot of the sentiments hold true back then.
JPEG XL has always been targeting high quality encoding metric first before the lower end low BPP images, which AV1 excels at with or without the last 6 years of improvements.
The current top comments about MP3 and LAME is again about how encoder extract maximum potential. JPEG XL was may be the best in 2021, but has been fighting for survival since then.
There a lot of different images that JPEG XL encode better. Screenshots with text is known to be not something they have optimised for or think it could be good at.
Had all of these, even just a hint of AVIF improvement be told may be the sentiments would have been a little different. But then again I am not one who would trust the same people who sold me WebP and AOM roadmaps.
But at least AV2 is coming. And JPEG XL is finally in every browser. Hopefully we can all have something even better in the future.
I think many people disliked Google's control of Chrome blocking JPEG XL rather than it being able to compete on its merits.
JPEG XL also has some big benefits for many use cases like lossless re-encoding and supporting higher resolution. AVIF images have a max size of 8192x4352 last I checked. That's not a problem for web images almost all of the time, but there's certainly uses where you might want more. I think AFIV might be limited to 12bit overall while JPEG XL can do 32bit. Again, is that something many will take advantage of on the web? No, but if it's something you care about it might be really meaningful to you.
Also, if you care about the 90% quality level, JPEG XL often outshines AVIF, but when I'm putting images on the web it's often well below that.
Some of it was bad information. I saw some people saying JPEG XL being way less computationally intensive (even less than WebP) and offering much better compression. Some of it was selective data - do you only test things at 95% quality level and declare a winner?
But I think the big thing is that a lot of people wanted the two formats to succeed or fail based on their merits. I think a lot of people don't like AVIF because it isn't well supported outside of browsers - and there can be a hope that the JPEG name would mean JPEG XL would get the kind of adoption JPEG did.
And it's hard to truly compare formats - or benchmark in general. As the article shows, different JPEG XL encoders offer vastly different performance. And when we're dealing with lossy compression, sometimes it can be a bit of personal preference. At some point, people started enjoying the way that MP3 garbled symbols (the instrument) and that was the sound they expected a symbol to make.
Your impression is correct; when JPEG XL was first introduced, it did just as well or better than AVIF in many cases. But in short, work on JPEG XL encoders slowed down, so they fell behind, and JPEG XL now loses to AVIF in some areas.
As the article points out, this might change yet again in the future, depending on how much AVIF keeps improving and whether JPEG XL development picks up steam again and how far it’ll go.
That F1 image is, in my mind, proof of exactly what is wrong with AVIF. If you look closely the beautiful highlights on the car have been erased and replaced with something plausible. Once you see it you can't unsee it and it boggles my mind that people are still using it as an example.
Granted, AVIF performs impressively for, say, a huge hero image for a blog where you're out to create an overall impression and people aren't going to look at it closely. It does not impress me when I am compressing photos I took with my mirrorless and I expect them to look like photos taken with a mirrorless and not cell phone snaps.
You're looking at it in a browser that doesn't support JPEG XL, so it's falling back to a WASM renderer, and I think it handles resizing differently.
This is totally my bad. I thought I was doing a good thing by adding that fallback renderer, but it isn't identical and it's giving people the wrong impression.
The lossless version is JPEG XL, hence the difference to AVIF.
None of which means you should expect your audience to have a new version which came out three days ago. Lots of technical people stay behind the bleeding edge for very good reason.
In Firefox 157.0.1, the right border of the image moves by a pixel or two when I press "hold for lossless" while viewing the AVIF. I think it's the lossy AVIF that's a bit too small.
"AVIF acceptable" is very heavily compressed. If you compress an image, and you keep compressing it, and you compress it even more, you get garbage not your original image. In the past, compression artifacts consisted of:
- huge pixely blocks
- loss of color variation (I still like gif bite me)
- blur
The AVIF image at that level looks like AI upscale, unrelated things blend onto each other. I don't really like it visually, but likely it still has the most details, and other formats would look more/much more garbage at that size.
Also, I wonder if encoders could detect distinct things fakely blending into each other, and prevent it (adding some more information back), in practice.
>Animated image formats are dumb and animated JPEG XL is no exception. Video formats are better at video. They're built for it. They're optimised for it. Not just in terms of encoding, but also in terms of playback.
This is something I've felt doesn't get enough attention when comparing JXL and AVIF. JXL can be the replacement for GIF.
><video muted autoplay> is right there.
>No, I'm not adding a demo. I don't want it on my server. Use video formats for video.
I'm not sure if "Use video formats for video" is saying to use AVIF over JXL or saying to use AV1 over AVIF. If the latter, GIF-like animations have a different enough user expectation that it makes sense to have it as something different from regular videos. Even <video muted autoplay> doesn't encode the full expected behavior because GIFs are not expected to have controls like pause, play and scrub. And even if you hide the controls users will expect similar behavior when opening it in an image viewer or in a new tab. Images do not have controls so they fit better as an image, although maybe they need their own category.
Also, I didn't realize how good AVIF was at progressive rendering. I don't think I knew it could do that at all. I think AVIF is the clear winner for the web, although it is still nice to have JXL for lossless. Somehow I feel that AVIF still hasn't gained as much usage as it should, especially now that it is supported almost everywhere. I think I see more webp than AVIF, and JPEG is still everywhere. Maybe now that JXL is out, developers will take another look? AVIF is supported by 96.35%-98.83% of browsers according to caniuse whereas webp is 97.18%-99.68% and JPEG is 97.28%-99.78%.
I also didn't know there was another Rust JXL decoder separate from jxl-rs named jixel.[0]
I agree that animated images make sense as a category. But I wish I did get controls on them when opened directly. Being unable to pause a gif leads to very annoying workarounds sometimes.
It'd be interesting to scale this up to a lot of images - and have users blind A/B test, like the LLM Arena on Huggingface which helped filter out "benchmaxxing" vs actual intelligence & utility. Because 1) images can be so diverse* and 2) an intrinsic tradeoff might exist between general efficiency and out-of-distribution robustness.
It's hard to rigorously judge a codec from a handful images, especially given the large impact they would have (with a widely adopted codec encoding bazillions of images in the coming years).
* There are many intricate details that go into codecs and visual perception. For instance, our sensitivity to visual errors are dependent on colors (all of hue, saturation, and brightness), spatial frequency of artifacts, local contrast and texture presence, et cetera.
And like OP mentioned, perceptual error metrics (including SSIMULACRA2) aren't perfectly representative of human-evaluated visual quality. For instance, libjxl deliberately makes choices that hurt SSIMU2 scores, but improve human-rated quality.
There was a study done while I was at Google, and I fought for it to be done on high density screens, because that's what most users have. The response was "but people won't be able to see the artifacts" and my head nearly rotated 180 degrees.
But yes, you can see this with jixel, which I'm really impressed by, but it's so tuned to SSIMU2 that it looks really bad to human eyes in some cases compared to libjxl.
But that is correct and why any proper study should first train the participants on the type of artifacts and trade-offs. Like the reference to JXL choices: think its creator mentioned that AVIF might look nicer for faces because it was "smoothing" them but it was a worse representation of the original. So the study participants would need to be conscious of that trade off and be clear in terms of what they're asked to evaluate - whether the result looks nicer or whether it represents the original better.
This is a good food for thought. Semi-related: It reminds me of the fact that smartphone cameras nowadays use ML based filters to make faces prettier before saving in the first place.
Perhaps we can use clever experiment design to address it, like doing a "full-reference" evaluation (e.g., pick most similar two images, out of encoder A, encoder B, and original) rather than strictly A/B.
The question now is how much of AVIF's advantage comes from the encoder compared to the image format itself. If it is the encoder, does JPEG XL even stand a chance of catching up? AVIF will certainly receive further improvements, albeit at a diminishing rate.
I've been using AVIF on my blog for a few years. My blog's image corpus is almost entirely videogame screenshots, and I keep the original PNGs so I can re-encode if better encoders release. Despite playing around with JPEGXL every year or so, AVIF images usually looked better (if only a little) at the same file size (vs JPEGXL).
After reading this article, there's something to point to prove I'm not going crazy.
> libjxl's maximum effort is very slow. It produces files 2–7% smaller than its default for photos, and ~25% smaller for the screenshot and illustration, but takes 9–46 seconds, which is 50–180x as long as its default. jixel gets the same results in a couple of seconds.
libjxl's slow speed at efforts >7 is primarily due to an iterative evaluation-optimization loop of a perceptual error metric called Butteraugli (by tuning quantization weights). In case anyone is interested, I've been working on a GPU-accelerated libjxl port (supporting CUDA and Metal for now) that makes this much faster, closer to libjxl's normal speeds: https://github.com/yunho-c/gjxl - geared for encoding a large batch images into JPEG XL. It's also faster by around 3x at normal effort.
Unfortunately for the comparison-focused blog post the comparison widgets is pretty bad - you can't quickly compare 2 reference pictures (original vs AVIF or original vs JXL) at different scalings like here https://web.archive.org/web/20200915201019/https://afontenot...
(also like the BPP size metric that is picture size-independent)
Wish that widget with improvements (that allows comparison of 3 pics with 3 buttons: original/codec1/codec2) were the widespread standard
(also, "hold" is a rather unergonomic action)
Otherwise, seems like AVIF has had impressive gains in both speed and quality, wonder whether JXL could catch up
AVIF is fantastic format and I use it in my production applications. Spent quite a bit of time looking to the best settings (at least for up to 2k images) and for anyone interested in converting images to AVIF, here's what I've found to work the best for creating the smallest size (10x+ smaller) while still retaining good quality and even supports PNG transparency:
in my app i was using jpeg but then switched to webp two years ago, they're for generating/displaying thumbnails for images and videos. and now avif seems like a better fit? anything that you're not happy about? considering avif now, appreciate any ideas
If you're working with images that need to be lossless or are simple in color diversity, WEBP is probably still a better choice (though not by a large margin). The biggest issue you might run into with AVIF is legacy support, particularly amongst Apple devices who were slower to implement support for it.
Otherwise the massive size reduction for storage and transfer speeds makes it incredibly attractive for modern web applications.
Plethora means an excessive amount, so I disagree.
Adding formats to the browser gives us more code to maintain, increases the binary size, and increases the attack surface area. That's why, at Firefox, we insisted on a Rust decoder.
> gives us more code to maintain, increases the binary size
In that case, don't nanny everything as a monolith. Let formats/codecs can be installed as extension/plugin.
For example I really want to webrtc to f' off, I can't. I can't even disable it for a particular site like microphone permissions. It sucks!
And to my knowledge, webrtc stack is so much more complicated than an image format, so many sites trying to grab my private IP using webrtc. yet every browser vendor are happy to support it!
Browser vendors want their browser to be safe to use. If we encourage users to essentially bake their own browser from a hodge podge of unverified third party code running at high privilege, we don't meet that goal.
An image codec can be run in a sandboxed way, with limited cpu/ram, the output is rastered pixels, how could this not be "safe"?
There are dozens of .wasm based image encoder/decoders, no?
It's not like it could access network or IO, unlike extensions do, which could steal your data after authors sell their popular extension and buys profits from stealing data from installed users.
This is exactly the kind of misunderstanding I worried about in another reply. [1]
AVIF uses the AV1 codec. For the past several years, AV1 has been enjoying a wide interest and a continuous stream of improvements as the best, open, royalty-free video codec around that pretty much everyone had agreed to support from the get go.
JPEG XL started out with a smaller group behind it and took a massive hit when Google decided not to support it in Chrome (and by extension, the entire web, because market share). That made JPEG XL’s future as the universal format very uncertain for a few years. Excitement waned, development slowed down and was further divided to develop a new encoder which Mozilla later said they wanted.
So for a good while, AVIF was steadily improving and approaching its full potential, while JPEG XL was not. The article compares the current state of the current encoders; in no way does it indicate how good the formats themselves are. The article makes note of this. [2] It’s been known for years that JPEG XL compression can still be improved by quite a bit, so I imagine the current encoders are still far from reaching the format’s full potential. (Heck, they don’t even make use of all its features from what I know!) Back when it was first proposed, JPEG XL was very competitive. With interest in the format hopefully renewed, we might see it catch back up with AVIF and overtake it again. Or we might not. We have no way of knowing for sure right now.
176 comments
[ 1.3 ms ] story [ 57.4 ms ] threadJPEG XL doesn't have that benefit, while sites adoption is arguably a worse issue than browser adoption.
To demonstrate the point even for AVIF itself - it has been in the browsers for a while. Can you use it on common sites? Good luck if you can, even major sites like GitHub and GitLab have issues with it due to some site code depending on hardcoded list of known formats or other similar problems.
ISO-BMFF container is bloated and needlessly complicated. AVIF decoders didn't even want to reuse existing MP4 libraries for it due to all the baggage it brings, and implemented their own minimal parsers.
AVIF would have been better off with a simple wrapper similar to RIFF/PNG or extending AV1's own OBU header (which for inexplicable reason gets its data duplicated inside the HEIF container and then implementations are required to verify that both copies agree!)
I hope AVIF will skip AV2. We don't need yet another almost-identical format to migrate to.
With no codec for a new compression algorithm, it does not matter if the browser can read the container, you still see the "broken image" icon on your display.
Many other image formats are. AVIF uses HEIC, the same container that HEIF does.
> when AV2, AV3 etc. will come out, there won't be a need to go through another very difficult phase of sites adoption - it will still be AVIF just with newer codec inside, and it will be just up to browsers to catch up on newer versions and newer codecs will address technical needs as times goes.
Fingers crossed, but AV2-based AVIF specs have yet to be finalized, so who knows.
Overall I am getting that AVIF is better on the web...unless Lossless is needed, in that case better take JPEGXL.
So, is animated AVIF only keyframes / p-frames, where each frame is independent from the other? I was under that impression, uncertain if there are any other capabilities it might have (like only updating part of the canvas when only parts change, like GIF supports)
Try it: run cjxl › djxl and hash the output against the original.
I am still on webp, thinking that I am on the bleeding edge in a world where artworkers are obsessed with pixels with JPG/PNG as the only formats they know, which is an advance on GIF.
Every browser advertises what formats it will accept and if it is in 'data-saving, low bandwidth mode', so I just configure the CDN to keep the names the same '.jpg' but to send the bestest format for the situation/browser, whether that be webp or AVIF, fetching super-high resolution files from the origin server, outputting them in 'retina' resolution with none of those 'picture' elements referencing half a dozen 'responsive' sizes.
In this way nobody has to care what image format is being served, and if it is deemed that everything is way too compressed, the CDN can be flushed of the cached images, quality increased, and cache rebuilt.
It looks like I will need to update my server configuration to use JPEG XL in the usual five years' time, given the lack of any revolutionary benefit.
I was at Google for 10 years, then went to Shopify for 2 years, but I missed the web. For most of the time I was at Google, it mostly did what was good for the web, rather than pushing Google's interests, but that started to change, which is one of things that led to me leaving. E.g. see what happened with the Prompt API.
I am always on Team Hamilton even though I appreciate that he is a little long in the tooth and doing the classic retirement act in a 'stupid red car'.
I am obsessed with SVG and image compression/delivery, and I would like it if you could introduce the concept of an 'SVG sampler' to the world. This is very much inspired by embroidery samplers from the times when women needed to sew.
The point of the sampler is to impress, so as to get the work in, however, it is also a reference, with stitches to copy for lettering, numbers, religious iconography, sock-darning, button-holes and whatever else needs to be repeated.
With an SVG sampler the idea is to use the whole SVG toolkit, filters, masks, clip paths, symbols, views, SMIL, CSS and everything else.
Sure this can be done in Inkscape, however, the goal of the SVG sampler is to make it human drawable. For example, the search icon is a circle and a line, which can be done in a 45Kb export from Illustrator, with the circle defined as a thousand points, specified to NASA numbers.
Or it can be done in ten lines or so of SVG primitives, with the circle and the line using simple two-digit integers. The former is not something that a mere mortal could draw, whereas the latter could be.
Clearly some paths do need to be complex and imported from elsewhere.
SVGOMG will be able to mash the 45Kb Illustrator export into a tenth the size, however, it will not be as concise or as human readable as the 'haiku of the SVG sampler symbol'.
The SVG sampler does not have to be web-optimised, it can max out the CPU for the PC to go full China Syndrome and melt its way through your desk. However, it could be forked, culled of CPU-eater show-stoppers, to just have the icons needed for the next project.
Another way of seeing the SVG sampler idea is 'SVG golf', where you want to strive for maximal 'use' clones, maximal human readability, yet also an insistence on detail such as light/dark mode currentColor things, animating pretty much everything and using the primitives rather than paths, even if the code is longererer according to SVGOMG.
I think that SVG falls within an awkward gap where artworkers don't care for the code with programmers also not caring for the code, because SVG is artworker stuff, not for programmers, right?
In a typical team workflow there is no scope for this to change, the frontend developer is obligated to use the 'assets' churned out by the art worker and the backend developer certainly doesn't care.
Hence, an SVG 'sampler' competition of sorts, with some acknowledgement, could help Firefox win over some developer mindset to FF. Already MDN has the de-facto best documentation for SVG, I probably have a dozen MDN tabs open right now, maybe with all of them on some type of FEconvolve type of feature.
For the sampler, the IDE rather than the graphics program is how it works. Anything with 'sodipodi' type of extra markup can be considered not worthy of being an SVG sampler. Really it has to be a mostly text-only thing, under version control, and not needing CodePen or other. To go with the SVG there needs to be a 'sampler.html' file to show the sampler symbols in 'inline mode' as well as CSS, the favicon and as shown as an 'image' element. Scripting is allowed, but really the goal is to keep everything in the SVG file, to not need huge amounts of extra files.
Ideally comments outside of 'title' and 'description' should not be needed, the author should be able to explain their own code, hence an emphasis on 'defs', sensible id names and descriptive ids.
Since F1 is your thing, you are welcome to give the SVG sampler idea a F1 inspired ethos to it. If you think of the FW14C with the active suspension and whatnot, or the F-duct, DAS and other wonders, then applied that design rigour to SVG, think how good it could be. Added marks for everything good looking, h...
JPEG-XL seems to be the best solution for storing and distributing high-quality images. For myself, I want high-quality images, so JPEG-XL is what matters, both for new images and for compressing old archives of JPEG images.
For a wide variety of usecases, not for every isolated usecase. Today, AVIF is better for showing people ads^W^W^W web content delivery. This article is titled “JPEG XL vs. AVIF for web use-cases”. The other article recently discussed¹ is subtitled “Investigating JPEG XL's place as a Web image codec” and ends:
> JPEG XL isn't useless; it is genuinely compelling technology for use cases beyond the Web.
¹ https://news.ycombinator.com/item?id=49690554
(Either way, can we agree to take webp out behind the barn?)
JPEG XL has always been targeting high quality encoding metric first before the lower end low BPP images, which AV1 excels at with or without the last 6 years of improvements.
The current top comments about MP3 and LAME is again about how encoder extract maximum potential. JPEG XL was may be the best in 2021, but has been fighting for survival since then.
There a lot of different images that JPEG XL encode better. Screenshots with text is known to be not something they have optimised for or think it could be good at.
Had all of these, even just a hint of AVIF improvement be told may be the sentiments would have been a little different. But then again I am not one who would trust the same people who sold me WebP and AOM roadmaps.
But at least AV2 is coming. And JPEG XL is finally in every browser. Hopefully we can all have something even better in the future.
JPEG XL also has some big benefits for many use cases like lossless re-encoding and supporting higher resolution. AVIF images have a max size of 8192x4352 last I checked. That's not a problem for web images almost all of the time, but there's certainly uses where you might want more. I think AFIV might be limited to 12bit overall while JPEG XL can do 32bit. Again, is that something many will take advantage of on the web? No, but if it's something you care about it might be really meaningful to you.
Also, if you care about the 90% quality level, JPEG XL often outshines AVIF, but when I'm putting images on the web it's often well below that.
Some of it was bad information. I saw some people saying JPEG XL being way less computationally intensive (even less than WebP) and offering much better compression. Some of it was selective data - do you only test things at 95% quality level and declare a winner?
But I think the big thing is that a lot of people wanted the two formats to succeed or fail based on their merits. I think a lot of people don't like AVIF because it isn't well supported outside of browsers - and there can be a hope that the JPEG name would mean JPEG XL would get the kind of adoption JPEG did.
And it's hard to truly compare formats - or benchmark in general. As the article shows, different JPEG XL encoders offer vastly different performance. And when we're dealing with lossy compression, sometimes it can be a bit of personal preference. At some point, people started enjoying the way that MP3 garbled symbols (the instrument) and that was the sound they expected a symbol to make.
As the article points out, this might change yet again in the future, depending on how much AVIF keeps improving and whether JPEG XL development picks up steam again and how far it’ll go.
* https://caniuse.com/?search=avif
* https://caniuse.com/?search=jpegxl
Granted, AVIF performs impressively for, say, a huge hero image for a blog where you're out to create an overall impression and people aren't going to look at it closely. It does not impress me when I am compressing photos I took with my mirrorless and I expect them to look like photos taken with a mirrorless and not cell phone snaps.
You're looking at it in a browser that doesn't support JPEG XL, so it's falling back to a WASM renderer, and I think it handles resizing differently.
This is totally my bad. I thought I was doing a good thing by adding that fallback renderer, but it isn't identical and it's giving people the wrong impression.
The lossless version is JPEG XL, hence the difference to AVIF.
"AVIF acceptable" is very heavily compressed. If you compress an image, and you keep compressing it, and you compress it even more, you get garbage not your original image. In the past, compression artifacts consisted of:
The AVIF image at that level looks like AI upscale, unrelated things blend onto each other. I don't really like it visually, but likely it still has the most details, and other formats would look more/much more garbage at that size.Also, I wonder if encoders could detect distinct things fakely blending into each other, and prevent it (adding some more information back), in practice.
This is something I've felt doesn't get enough attention when comparing JXL and AVIF. JXL can be the replacement for GIF.
><video muted autoplay> is right there.
>No, I'm not adding a demo. I don't want it on my server. Use video formats for video.
I'm not sure if "Use video formats for video" is saying to use AVIF over JXL or saying to use AV1 over AVIF. If the latter, GIF-like animations have a different enough user expectation that it makes sense to have it as something different from regular videos. Even <video muted autoplay> doesn't encode the full expected behavior because GIFs are not expected to have controls like pause, play and scrub. And even if you hide the controls users will expect similar behavior when opening it in an image viewer or in a new tab. Images do not have controls so they fit better as an image, although maybe they need their own category.
Also, I didn't realize how good AVIF was at progressive rendering. I don't think I knew it could do that at all. I think AVIF is the clear winner for the web, although it is still nice to have JXL for lossless. Somehow I feel that AVIF still hasn't gained as much usage as it should, especially now that it is supported almost everywhere. I think I see more webp than AVIF, and JPEG is still everywhere. Maybe now that JXL is out, developers will take another look? AVIF is supported by 96.35%-98.83% of browsers according to caniuse whereas webp is 97.18%-99.68% and JPEG is 97.28%-99.78%.
I also didn't know there was another Rust JXL decoder separate from jxl-rs named jixel.[0]
[0] https://github.com/awxkee/jixel
Though given the lagging speed in decoding, is there a faster tying JXL decoder planned?
2. Is it possible to encode AVIF with hardware acceleration?
It's hard to rigorously judge a codec from a handful images, especially given the large impact they would have (with a widely adopted codec encoding bazillions of images in the coming years).
* There are many intricate details that go into codecs and visual perception. For instance, our sensitivity to visual errors are dependent on colors (all of hue, saturation, and brightness), spatial frequency of artifacts, local contrast and texture presence, et cetera.
And like OP mentioned, perceptual error metrics (including SSIMULACRA2) aren't perfectly representative of human-evaluated visual quality. For instance, libjxl deliberately makes choices that hurt SSIMU2 scores, but improve human-rated quality.
But yes, you can see this with jixel, which I'm really impressed by, but it's so tuned to SSIMU2 that it looks really bad to human eyes in some cases compared to libjxl.
But that is correct and why any proper study should first train the participants on the type of artifacts and trade-offs. Like the reference to JXL choices: think its creator mentioned that AVIF might look nicer for faces because it was "smoothing" them but it was a worse representation of the original. So the study participants would need to be conscious of that trade off and be clear in terms of what they're asked to evaluate - whether the result looks nicer or whether it represents the original better.
Perhaps we can use clever experiment design to address it, like doing a "full-reference" evaluation (e.g., pick most similar two images, out of encoder A, encoder B, and original) rather than strictly A/B.
After reading this article, there's something to point to prove I'm not going crazy.
libjxl's slow speed at efforts >7 is primarily due to an iterative evaluation-optimization loop of a perceptual error metric called Butteraugli (by tuning quantization weights). In case anyone is interested, I've been working on a GPU-accelerated libjxl port (supporting CUDA and Metal for now) that makes this much faster, closer to libjxl's normal speeds: https://github.com/yunho-c/gjxl - geared for encoding a large batch images into JPEG XL. It's also faster by around 3x at normal effort.
(also like the BPP size metric that is picture size-independent)
Wish that widget with improvements (that allows comparison of 3 pics with 3 buttons: original/codec1/codec2) were the widespread standard (also, "hold" is a rather unergonomic action)
Otherwise, seems like AVIF has had impressive gains in both speed and quality, wonder whether JXL could catch up
The images in the article max out at the maximum size I'd want them displayed.
Otherwise the massive size reduction for storage and transfer speeds makes it incredibly attractive for modern web applications.
Adding formats to the browser gives us more code to maintain, increases the binary size, and increases the attack surface area. That's why, at Firefox, we insisted on a Rust decoder.
In that case, don't nanny everything as a monolith. Let formats/codecs can be installed as extension/plugin.
For example I really want to webrtc to f' off, I can't. I can't even disable it for a particular site like microphone permissions. It sucks!
And to my knowledge, webrtc stack is so much more complicated than an image format, so many sites trying to grab my private IP using webrtc. yet every browser vendor are happy to support it!
There are dozens of .wasm based image encoder/decoders, no?
It's not like it could access network or IO, unlike extensions do, which could steal your data after authors sell their popular extension and buys profits from stealing data from installed users.
AVIF uses the AV1 codec. For the past several years, AV1 has been enjoying a wide interest and a continuous stream of improvements as the best, open, royalty-free video codec around that pretty much everyone had agreed to support from the get go.
JPEG XL started out with a smaller group behind it and took a massive hit when Google decided not to support it in Chrome (and by extension, the entire web, because market share). That made JPEG XL’s future as the universal format very uncertain for a few years. Excitement waned, development slowed down and was further divided to develop a new encoder which Mozilla later said they wanted.
So for a good while, AVIF was steadily improving and approaching its full potential, while JPEG XL was not. The article compares the current state of the current encoders; in no way does it indicate how good the formats themselves are. The article makes note of this. [2] It’s been known for years that JPEG XL compression can still be improved by quite a bit, so I imagine the current encoders are still far from reaching the format’s full potential. (Heck, they don’t even make use of all its features from what I know!) Back when it was first proposed, JPEG XL was very competitive. With interest in the format hopefully renewed, we might see it catch back up with AVIF and overtake it again. Or we might not. We have no way of knowing for sure right now.