Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > VP9 and AV1

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th January 2025, 20:22   #1  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 329
Why Not Use AVIF?

Many people say I shouldn't use lossless animated AVIF image files (not video files) because it's not truly lossless, the lossless options for AV1 are terrible and it's not even really lossless if the input videos aren't AV1. They also say that WEBP, JXL, and even PNG are better options even though AVIF offers less file size than them.

Are all of these statements true?

Last edited by jay123210599; 14th January 2025 at 20:24.
jay123210599 is offline   Reply With Quote
Old 14th January 2025, 20:47   #2  |  Link
a.ok.in
Registered User
 
Join Date: Oct 2024
Posts: 3
Quote:
Originally Posted by jay123210599 View Post
Many people say I shouldn't use lossless animated AVIF image files (not video files) because it's not truly lossless, the lossless options for AV1 are terrible and it's not even really lossless if the input videos aren't AV1. They also say that WEBP, JXL, and even PNG are better options even though AVIF offers less file size than them.

Are all of these statements true?
I'm not really sure if it isn't truly lossless, but I heard that AV1 lossless has worse compression than AVC/HEVC, and the situation is the same with still images against WEBP Lossless and JXL (It is more or less equal HEIC, and usually they're behind PNG in lossless efficiency, or so I have read).
a.ok.in is offline   Reply With Quote
Old 14th January 2025, 21:54   #3  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,600
Quote:
Originally Posted by jay123210599 View Post
Many people say I shouldn't use lossless animated AVIF image files (not video files) because it's not truly lossless, the lossless options for AV1 are terrible and it's not even really lossless if the input videos aren't AV1. They also say that WEBP, JXL, and even PNG are better options even though AVIF offers less file size than them.

Are all of these statements true?
No

If you're starting with YUV video sources - then it's actually the opposite - PNG , WEBP, JPEG-XL are not truly lossless because they do not support YUV lossless .

YUV to RGB is a lossy transform in general, unless the conversion is done properly, and RGB is in float . i.e you can never get back the original YUV values from the source video using PNG, WEBP, JPEG-XL - so they are actually the ones that are mathematically lossy if you start with YUV video, not AVIF. This point doesn't matter too much for viewing purposes, because when you "view" something, it has been converted to RGB for display.



The main reason you shouldn't use animated AVIF because of low compatibility - Limited software support.
poisondeathray is offline   Reply With Quote
Old 14th January 2025, 23:46   #4  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 329
Quote:
Originally Posted by poisondeathray View Post
No

If you're starting with YUV video sources - then it's actually the opposite - PNG , WEBP, JPEG-XL are not truly lossless because they do not support YUV lossless .

YUV to RGB is a lossy transform in general, unless the conversion is done properly, and RGB is in float . i.e you can never get back the original YUV values from the source video using PNG, WEBP, JPEG-XL - so they are actually the ones that are mathematically lossy if you start with YUV video, not AVIF. This point doesn't matter too much for viewing purposes, because when you "view" something, it has been converted to RGB for display.



The main reason you shouldn't use animated AVIF because of low compatibility - Limited software support.
What about these (look at the comments down below in these posts)?
https://www.reddit.com/r/AV1/comment...dont_use_avif/
https://www.reddit.com/r/AV1/comment..._avif_support/
https://www.reddit.com/r/AV1/comment...animated_avif/
jay123210599 is offline   Reply With Quote
Old 15th January 2025, 00:04   #5  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,600
Quote:
Originally Posted by jay123210599 View Post
What about them ?
poisondeathray is offline   Reply With Quote
Old 15th January 2025, 00:15   #6  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 329
Quote:
Originally Posted by poisondeathray View Post
What about them ?
Did you see what they said? Are they wrong?
jay123210599 is offline   Reply With Quote
Old 15th January 2025, 00:21   #7  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,600
Quote:
Originally Posted by jay123210599 View Post
Did you see what they said? Are they wrong?

Yes, some of them are wrong, and some assumed you meant a RGB single image.

The comments about AVIF having low compatibility are correct

None of them are lossless, from a YUV source, except AVIF. That is the background information they are missing, that I have knowledge about. It's a different situation, a different context

AVIF uses advanced temporal compression - so for animated YUV formats, not a single RGB image, AVIF going to have very high compression ratios (very small filesizes) .
poisondeathray is offline   Reply With Quote
Old 16th January 2025, 18:16   #8  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,956
Quote:
Originally Posted by jay123210599 View Post
Many people say I shouldn't use lossless animated AVIF image files (not video files) because it's not truly lossless, the lossless options for AV1 are terrible and it's not even really lossless if the input videos aren't AV1. They also say that WEBP, JXL, and even PNG are better options even though AVIF offers less file size than them.

Are all of these statements true?
We aren't at the point where a web page could use JUST AVIF safely. But a big and growing share of browsers support it, and AVIF by default with legacy fallback is reasonable for a site that has the kind of traffic and image file density to justify the overhead.

Mathematically lossless is only needed for particular use cases. AVIF can be perceptually lossless for typical images, which is generally enough.

AVIF can be a quality solution. Of course, quality isn't defined in abstract, but in terms of use. So, it really depends on what you're trying to do! If you're making a custom app to rapidly flip through large volumes of images over 4G networks, AVIF would be an awesome fit. If you're looking for lossless archiving of camera RAW images, that's outside of AVIF's scope. In general, compatibility is the only reason why AVIF (or HEIC) wouldn't always be better than JPEG or PNG.

So, tell us what use cases you're thinking of, and it'll be a lot easier to say if AVIF or any tech is a good fit for it.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 17th January 2025, 08:20   #9  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Posts: 370
Quote:
Originally Posted by poisondeathray View Post
No

If you're starting with YUV video sources - then it's actually the opposite - PNG , WEBP, JPEG-XL are not truly lossless because they do not support YUV lossless .

YUV to RGB is a lossy transform in general, unless the conversion is done properly, and RGB is in float . i.e you can never get back the original YUV values from the source video using PNG, WEBP, JPEG-XL - so they are actually the ones that are mathematically lossy if you start with YUV video, not AVIF. This point doesn't matter too much for viewing purposes, because when you "view" something, it has been converted to RGB for display.



The main reason you shouldn't use animated AVIF because of low compatibility - Limited software support.
They "can" use YUV lossless if some wild technique is used

I just tried shuffle YUV444P10LE planes directly into JXL (padded, as GBRP16LE) and they are smaller than x264 x265 aom-av1 vpx-vp9 lossless.
(edit: I accidently used 8bit PNG for comparison, the real 16bit PNG loses here.)

For 8bit it will be more straightforward

But you are certainly correct, when talking about lossless image compression many people including me just assumes that the input is RGB automatically.
If the YUV (subsampled, even) is converted to RGB in the normal way it's not real lossless anymore, and the compression ratio comapred to compress the YUV data directly is much worse.

Last edited by Z2697; 17th January 2025 at 10:57.
Z2697 is offline   Reply With Quote
Reply

Tags
av1, image compression, image-quality

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.