AVIF animations

Dex-chan lover
Joined
Mar 20, 2024
Messages
230
I understand that the support for AVIF format has been a rejected feature three years ago.

However, now in 2024 the same format is supported in the latest versions of every popular web browser (the last to support it was Microsoft Edge 121 and the previous one was Mozilla Firefox 113), and though the initial arguments about manga reading experience are still valid, perhaps at the forums the matter is somewhat different.

Consider AVIF as a lightweight alternative for GIF using the following three examples:

that one GIF is six megabytes and 640×360 pixels and about thirty frames per second,

that one GIF is more than 7⅔ megabytes and also 640×360 pixels and about thirty frames per second,

that one AVIF is about 1⅚ megabytes and fullHD 1920×1080 pixels and original 60 frames per second, it is not constrained by the GIF of 256 colors per frame, it does not introduce any generation loss (a quote from the YouTube's AV1 source has been losslessly remuxed into this animated AVIF).

However, the latter does not seem supported by the forum yet (a red «×» appears).

You may also consider AVIF as a lightweight alternative for JPEG, though the filesize difference is smaller (about 2× on average).

A current screenshot of https://caniuse.com/avif is attached below:

cjFA.webp
 
Head Contributor Wrangler
Staff
Super Moderator
Joined
Jan 18, 2018
Messages
1,948
Linked thread is regarding serving .AVIF for site/chapter images, which is a wholly different issue to this; note that our minimum browser version support list includes a lot of clients that don't support .AVIF, and this would kneecap a lot of users; most significantly, anyone stuck on iOS 15 would be completely screwed.
 
Dex-chan lover
Joined
Jan 8, 2023
Messages
1,126
What your opinions on WebP vs AVIF?

I currently in the process of converting many of my JPEG collection to WebP for long term unimportant images storage, so I want to know that what I do is not a waste of time.

Edit: Sorry, it seems I out of topics.
 
Last edited:
Dex-chan lover
Joined
Mar 20, 2024
Messages
230
First of all, neither WebP nor AVIF is the best tool of saviing space by converting JPEG files to a newer format.

The best such new format (or at least better than both of the above) is JPEG XL because it offers the conversion that is lossless (does not introduce any generation loss) and also is reversible (the resulting JPEG XL can be converted back to the original JPEG). The command line that yields the most compression effort would look like this (in the latest encoder):

cjxl --effort=10 --brotli_effort=11 --lossless_jpeg=1 original.jpg compressed.jxl

The resulting JPEG XL is usually 8%—10% smaller than the original JPEG if the original JPEG has already been optimized (by jpegoptim or a similar tool) and about 20% smaller otherwise.

Having said all that, now I can list my opinions on WebP vs AVIF:

① AVIF is able to store not only 24-bit pixels (TrueColor), but also 30-bit and 36-bit. WebP cannot go beyond 24-bit pixels and thus is a worse tool for images of wide color gamuts (WCG) or high dynamic ranges (HDR).

② As a tool of lossless compression of 24-bit pixels, however, WebP is better than PNG and better than AVIF. An improvement of lossless compression in AVIF would require a new colorspace (YCgCo-R) that is currently not implemented in libavif and also is likely to not have adequate decoders in current versions of web browsers.

③ As a tool of lossy compression of still images, AVIF is noticeably better that WebP and on average is twice better than JPEG. When the compression needs to be stronger (less than 1 bit per average pixel), then AVIF becomes an even better tool (thrice better than JPEG) because the quality of overcompressed JPEG files has always been inadequate.

④ As a tool of lossy compression of animations, animated AVIF is much more powerful than animated WebP. As a format, animated WebP offers very limited means of intra-frame compression (just some blending against the previous frame), and even those are plagued by the bugs of the official encoder for many years (see, for example, the illustrations of its bug 523 and bug 554). On the contrary, animated AVIF applies numerous intra-frame compression techniques (not just some blending, but also motion compensation) that are also bi-directional (not limited by using only the previous frames) and thus AVIF encoders usually build a multi-layered pyramid of intra-frame predictions within every group of frames. Hence the difference in the power of compression might be at least an order of magnitude (in favour of AVIF) if the frames are predictable enough.

An earlier trick of artificially raising the bit depth (using 10-bit colour components and thus 30-bit pixels) for better compression, initially discovered in AVC (H.264) videos, is also applicable in AVIF.
 
Last edited:
Dex-chan lover
Joined
Jul 30, 2020
Messages
127
If you use anything other than png or jpeg for still images, I'll find you and make you eat an A4 paper.
 
Dex-chan lover
Joined
Mar 20, 2024
Messages
230
worst codecs ever implemented from encoding/decoding time point
Usually not a problem unless you're encoding, say, 1200×7270 pixels or something.

If you use anything other than png or jpeg for still images, I'll find you and make you eat an A4 paper.
My original post (the one with the suggestion) has a WebP attachment. Have you had a problem with that, I wonder?
 
Dex-chan lover
Joined
Jul 20, 2019
Messages
423
APNG is also a stepup from gif and should be old enough to be in the minimum supported browser range.

(I didn't check if the forum supports it.)
 

Users who are viewing this thread

Top