Page 1 of 1
BUG: AVIF, WEBP - Conversion
Posted: Wed Jun 26, 2024 3:58 pm
by Rosh
When I convert a .PNG file (with an Alpha Channel), to AVIF [LossLESS] format, and then re-compared the result Pixel by Pixel (using software techniques), the AVIF [LossLESS] format alters the parts of the image. Change is Not visually perceivable.
To make SURE, double check: I converted the original .PNG (again) and the AVIF to .PNG format (same settings). Then I did a Binary compare on the conversion produced .PNG files, they were different!
Happens with most image files (usually on the Alpha Channel affected sections)
I have attached the image files (in a .ZIP file)
Visual comparison (Pixel by Pixel),
Top-Left: Original PNG
Top-Right: AVIF
Bottom: Pixel Changes

- Visual comparison (Pixel by Pixel), Red highlights changes:
UPDATE:
Same behaviour for conversion to WebP
Re: BUG: AVIF - Conversion
Posted: Mon Jul 01, 2024 8:59 am
by xnview
I confirm that output to AVIF/HEIF in lossless is not binary equivalent. I need to check libheif...
Re: BUG: AVIF, WEBP - Conversion
Posted: Mon Jul 01, 2024 9:27 am
by Rosh
Also the same for conversion to .WEBP (I encountered).
And maybe more formats ? (I have not checked them all). Maybe you can do some through checking.
Re: BUG: AVIF, WEBP - Conversion
Posted: Mon Jul 01, 2024 11:50 am
by xnview
Rosh wrote: Mon Jul 01, 2024 9:27 am
Also the same for conversion to .WEBP (I encountered).
?
For AVIF/HEIC, it's perhaps due to color space conversion...
Re: BUG: AVIF, WEBP - Conversion
Posted: Mon Jul 01, 2024 11:53 am
by Rosh
The problem also happens when going from PNG to WEBP [LossLESS]. In WebP There are changes (not True LossLESS).
Re: BUG: AVIF, WEBP - Conversion
Posted: Mon Jul 01, 2024 11:56 am
by Rosh
xnview wrote: Mon Jul 01, 2024 11:50 am
Rosh wrote: Mon Jul 01, 2024 9:27 am
Also the same for conversion to .WEBP (I encountered).
For AVIF/HEIC, it's perhaps due to color space conversion...
Look at the Comparison preview image, at the section that should be 100 percent transparent. Note that the image indicated that different part of the transparency are affected differently. Since all pixels were 100 percent transparent (or white if not) - I may not be due to colour space conversion, because if it was, then the in the preview the 100 percent tranparency area should not have a 'pattern', rather should be solid change in colour.
Re: BUG: AVIF, WEBP - Conversion
Posted: Mon Jul 01, 2024 12:01 pm
by xnview
do you see same thing with 24bits image?
Re: BUG: AVIF, WEBP - Conversion
Posted: Mon Jul 01, 2024 2:40 pm
by Rosh
I only tried with 24-Bit images (with Alpha Channel). I.e. the example I attached previously.
Some other formats work fine, i.e. PNG to PNG does not alter.
Re: BUG: AVIF, WEBP - Conversion
Posted: Fri Jul 05, 2024 9:55 am
by Danny
AFAIK that's expected, because AVIF isn't actually 100% lossless per definition; only visually. Simply because there's always a YUV <-> RGB conversion happening when you open/save an image.
It's only lossless in the sense that, if you open an AVIF file, change only part of it and then save it again, the parts that didn't change should be 100% identical to before. That likely won't be the case, if there was a color mode conversion (PNG is RGB).
Re: BUG: AVIF, WEBP - Conversion
Posted: Sun Jul 07, 2024 5:13 pm
by Rosh
Danny wrote: Fri Jul 05, 2024 9:55 am
AFAIK that's expected, because AVIF isn't actually 100% lossless per definition; only visually. Simply because there's always a YUV <-> RGB conversion happening when you open/save an image.
It's only lossless in the sense that, if you open an AVIF file, change only part of it and then save it again, the parts that didn't change should be 100% identical to before. That likely won't be the case, if there was a color mode conversion (PNG is RGB).
Then... why the 'pattern' effect in the
100 percent transparent area, in the comparison image (first post).