AVIF support enabled by default in Firefox 86
bugzilla.mozilla.org
bugzilla.mozilla.org
https://jakearchibald.com/2020/avif-has-landed/
This is incredible.
I really wish something existed (or was even built-in to image format encoders in some way, although I recognise that would arguably be bloat) to "bisect" what the optimum settings are per format without degrading quality based off perceptual pixel differences...
I've written a basic thing myself I use to work out the chroma sub sampling (whether 444 is needed, or if 422 can be used) for JPEG encoding photos, and it can do a fair level of "quality" bisection as well, but it's far from perfect, but still useful.
In practice, I never really used it. I toyed with it once or twice, I turn it on every time because with jpg it often yields marginally lower file sizes anyway (in gimp you can preview file size and looks), but never heard anyone say "what was that magic" and whenever I see it on websites I think to myself "yeah okay that 20x20 pixel image, it could have saved a render cycle, this is useless and looks terrible" before it downloads to 100% before the next render cycle.
So I'm not sure it will really be missed, even if you saddened my inner nerd. I really do like the feature, it's really neat to just load as much as you wish and get however much 'quality' fits within that data size.
I guess it depends at what point it does the first render. I rarely see images load progressively in the first place, but when I do it's usually with an initial render that looks like 1967 needs their image back. My guess is that it's busy downloading the many/largeish js/css files that prevent it from getting very far on images before the DOM is ready for initial render.
I honestly could not tell it was still going after the 2nd progressive layer.
This could happen due to DC shifts (one pixel gets quantized, the rest are coded as a difference from it), or a mistake in the post-decoding pipeline (gamma/colorspace correction).
But you're right, probably just error due to compression/quantization etc. in DC shift or in colorspace conversion. It seems to happen in low quality JPEG too after I did some quick tests myself.
For F1 image, if you compare 20KB JPEG vs 18KB AVIF, there's no doubt AVIF is better. But if this picture is the content of page, not some useless decorations, I'd rather be served with 70KB JPEG in this example, it isn't really a close competition. So I wonder if 40-50-60 KB AVIF would look as good or better than 70 KB JPEG. Then it would be impressive. Otherwise, it isn't really a drop-in replacement and I wonder what the correct use-case strategy should be.
It would have been good if the article also included an AVIF image increased in quality to match the JPEG’s DDSIM score, or at least indicated what that quality level was. I’d expect that 30KB would be sufficient, quite possibly even 25KB.
> In fact, when I showed this article to Kornel Lesiński (who actually knows what he's talking about when it comes to image compression), he was unhappy with my F1 comparison above, because the DDSIM score of the JPEG is much lower than the others, meaning it's closer in quality to the original image, and… he's right.
> I struggled to compress the F1 image as JPEG. If I went any lower than 74 kB, the banding on the road became really obvious to me, and some of the grey parts of the road appeared slightly purple in a noticeable way, […]
> The fine detail of the road is lost in all of the compressed versions, which I'm ok with. However, you can see the difference in detail Kornel was talking about. Look at the red bodywork in the original, there are three distinct parts – the mirror, the wing connecting the bargeboard, and the top of the sidepod. In the AVIF, the smoothing removes the division between these parts, but they're still mostly there in the JPEG, especially the 74 kB version.
It is incredible to me that in 2021 the web makes it impossible to get even vaguely correct colours onto a screen.
I don't know who's to blame here: Web standards bodies, Mozilla, or the specific AVIF decoder.
But I do know that color-blind people are creating the next generation of imaging standards.
The one group highly unlikely to blame here is web standards bodies, who don't have anything to do with how image formats are rendered (it gets as far as defining the default colour space when none is provided, but that's it). But I'd guess it's likely an image file problem rather than a display problem.
I'm pretty sure I can blame a web standards body for not standardising colour management for the web!
The colour space of embedded images is no longer the only concern, and is not separate from the colours as defined in CSS, SVG, and Canvas to name a few.
Not to mention that even greyscale images need colour management because Macs, PCs, and Televisions all use different gamma curves.
W3C's efforts have been so underwhelming that Apple, the "bastion" of web standards support has been forced to come up with a non-standard extension: https://webkit.org/blog/10042/wide-gamut-color-in-css-with-d...
Of course, their extension supports exactly two colour spaces: sRGB and Display P3, because fuck everyone else who isn't using an iDevice or a Mac, am I right?
If I sound salty, it's because I'm a photographer, and as such it grinds my gears that it is literally impossible to use wide-gamut images on the web for any purpose without degrading quality for a substantial fraction of the viewers. I fully expect this to be resolved satisfactorily some time in the 2030s, perhaps the 2040s. Any decade now...
I found this article on fidelity vs appeal handy, especially to illuminate the problems with AVIF's algorithm when you are showing off photos.
https://cloudinary.com/blog/what_to_focus_on_in_image_compre...
I'm waiting for JPEG-XL. And then color management after that.
The other image formats are colour-managed, so they look relatively desaturated on my WCG monitor. The AVIF images look "stretched" to the full gamut, making them garishly oversaturated.
> At an 'effort' of 2, it takes a good few seconds to encode. 'Effort' 3 is significantly better, but that can take a couple of minutes. 'Effort' 10 (which I used for images in this article) can take over 10 minutes to encode a single image.
> The command line tools are orders of magnitude faster
and from the previous sentence:
> Encoding AVIF takes a long time in general, but it's especially bad in Squoosh because we're using WebAssembly, which doesn't let us use SIMD or multiple threads
While JPEG2000 doesn't catch on, it's still used moderately in some fields, particularly medical imaging and some other scientific imagings. And the use of wavelet-transform based algorithms in compression is adopted in lots of other formats too.
its shipping in RED cameras under the name REDCODE ;)
Good question though time to revisit jp2.
It's an image format based on the keyframes of the AV1 video codec.
WebP afaik has a more limited feature set.
Thanks Apple for being behind the times.
https://css-tricks.com/webp-image-support-coming-to-ios-14/ https://caniuse.com/?search=webp
_Internet Explorer is a component of the Windows operating system and follows the Lifecycle Policy for the product on which it is installed._
Some of their sites are like Office365 will drop support, but only on 2021-08-17.
I have known the author of WebP (he previously worked on XviD) and I'm pretty sure it was his pet project.
It's silly that there are video formats with excellent compression but image formats want to reinvent it (such as animated PNG, animated WebP, animated AVIF...). It just adds extra complexity to image formats.
[1] https://developer.apple.com/documentation/webkit/delivering_...
https://bugs.chromium.org/p/chromium/issues/detail?id=791658
It all boils down to codec support. Past year Apple finally started supporting Google codecs, so Safari gained VP9 and WebP.
Thanks for correcting me.
In order to get mainstream adoption, both Safari iOS and Chrome Android need to start supporting it.
I don't expect Apple to ever implement AVIF. They have bought into HEIF as the new version of JPEG through licenses and hardware decoding and they're not exactly known of implementing open standards next to their own.
Encoding WEBP and AVIF and using the <picture> element on web pages should solve the bandwidth problem without depending on outdated browsers or lacking browser manufacturers. AVIF is better than WEBP in many cases, but WEBP is also better than JPEG or PNG in many places the older formats are still used.
Apple added AV1 hardware decode support to the A14 so I wouldn't rule it out in the future.
Looks like it's the pre-Android 5, non-Chromium, AOSP browser ?
Where is that happening?
https://blog.uidrafter.com/engineering/conditional-avif-for-...
H.265 debacle with 2 patent holder groups is a good example of that.
H.265 is an anti-example, because there patents were pooled for offensive purposes to begin with, while AOM pooled resources for defense. I.e. something like MPEG-LA exists to extort money, not to defend anyone. That's also why you got two separate pools there. Patent aggressors don't want to share, each of them wants to get all the loot for themselves.
I am not a lawyer, and I realize there's a fine line between genuine concern and spreading FUD, but in the spring of 2019 I looked into the patent situation around the HEIF container itself [1] -- the container upon which AVIF builds -- and skimmed through the 5 US patents I found, which cover some techniques that can be used in the format. Most of them can probably be avoided for the purposes of an AVIF file, but patent US20160232939A1 [2] in my reading seems to be about in-container signalling to express relationships between a "static media item" and "one or more entities" that together "form a group", and "indicating, in the file, a grouping type for the group". The patent appears to be written in a way to allow this definition to encompass, say, a thumbnail and a bunch of frames thereafter, or, say a master image and a set of pictures derived from it, or alternate camera angles of the same thing. Some of these techniques sound like stuff we've seen before, but as is common in patents, the precise wording of claims is often key, and this is where patent lawyers come in.
A thorough look of the AVIF specification [3] and the patents registered with the MPEG LA about this format [1] is likely wise before any widespread deployment that makes use of advanced features of the HEIF container; using it to hold exactly 1 'one-layer' still-image is probably fine.
Additionally, in my reading [5], the HEIF reference software released by Nokia [4] includes a patent grant for non-commercial evaluation, testing and academic research only.
[1] https://news.ycombinator.com/item?id=19874321 [2] https://patents.google.com/patent/US20160232939A1/ [3] https://aomediacodec.github.io/av1-avif/ [4] https://github.com/nokiatech/heif/blob/master/LICENSE.TXT [5] https://news.ycombinator.com/item?id=19874368 [6] https://en.wikipedia.org/w/index.php?title=AV1&oldid=9976507... [7] https://github.com/AOMediaCodec/av1-avif/issues/2
And I do think taking median Image size and bitrate on Internet was the wrong point of optimisation. Lots of image on the internet just aren't properly optimised.
I think and I may be wrong, the format is now finalised. ( The original schedule was last July... so it was delayed abit ) People who are interested could start testing it.
Reducing the size of existing image collections with zero quality loss will make JPEG XL a success no matter what else happens.
https://github.com/google/brunsli
I personally use the cbrunsli/dbrunsli cmdline programs to archive old high-resolution JPEG photos that I've taken over the years. Having a gander at one subdirectory with 94 photos @ 354 MB in size, running cbrunsli on them brings the size down to 282 MB, which brings in savings of about 20%. And if I ever wanted to convert them back to JPEG, each file would be bit-identical to the originals.
Perhaps it's a little early to trust my data to JPEG XL/Brunsli, but I've ran tests comparing hundreds of MD5 checksums of JPEG files losslessly recreated by Brunsli, and have not yet ran into a single mismatch.
I can only say that I am very excited for the day that JPEG XL truly hits primetime.
Blocking artifacts can be reduced with a deblocking filter; JPEG/MPEG1/MPEG2 are so simple it doesn't take much work to guess what was supposed to be there.
After experimeting with the quantizer, these are the settings I use for screenshots with text and sharp lines: https://blog.uidrafter.com/engineering/convert-to-avif-progr...
https://fronius.me/articles/2020-10-14-comparing-image-forma...
https://fronius.me/articles/2020-10-14-comparing-image-forma...
I'm trying to use avifenc (Debian testing) and getting this:
avifenc test.png test.avif
...
Encoding with AV1 codec '(null)' speed [8], color QP [0 (Lossless) <-> 10 (High)], alpha QP [0 (Lossless) <-> 0 (Lossless)], tileRowsLog2 [0], tileColsLog2 [0], 1 worker thread(s), please wait...
ERROR: Failed to encode image: No codec available magick testimage.png testimage.avif
magick testimage.png -quality 60 testimage60.avif
[0] https://imagemagick.org/script/magick.phpI can try getting version 7.
[0] https://github.com/ImageMagick/ImageMagick/issues/1432#issue...
Also, the difference between imagemagick 6 and 7 isn't simply about being an older version.
(A lot of people use "testing" for reasons I have not been able to comprehend. The main difference from "unstable" is it takes a minimum of 2 weeks for fixes to show up in "testing". Or did, last I checked.)
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976349
That's weird for something that's called avifenc.
https://squoosh.app/ has both avif and jpegxl if you want to try it out.
AVIF does not support recompression of JPEG files like Lepton, Brunsli, PackJPG, 7zip media layer (using Brunsli), and JPEG XL. AVIF works very well in the high density low-bit-rate compression. The flip side there is loss of detail.