Closed nilsonbazana closed 1 year ago
Is "quality" an official part of the spec (ie the numbers have a fixed meaning), or open to interpretation between different implementations of AVIF encoders?
There are other potential factors within the spec, such as the encoder effort, that could influence size. Bit depth is a big one, so you'd want to make sure other variables are held constant for the comparison.
Is "quality" an official part of the spec (ie the numbers have a fixed meaning), or open to interpretation between different implementations of AVIF encoders?
The "quality" value is open to interpretation between encoder implementations.
Internally AOM uses a quality range where 0 is the best and 63 is the worst (this range may be from the AV1 spec, I'm not sure), the encoders that use AOM are free to pick how they map that to the standard [0, 100] range. There are also a bunch of other encoder settings that may influence the encoding behavior. Other AV1 encoders (e.g. rav1e or svt) may have different settings and/or defaults than AOM.
XnviewMP appears to be using libavif, I do not know what encoder it is configured to use. Looking at the source code for the libheif AOM encoder plugin, it appears to be simultaneously using 2 different methods of setting the encoder quality. 😕 I have no idea how those 2 methods would interact.
It appears that the next version of libavif will have the option to use a similar quality value to libheif, with the quality value in the [0, 100] range. The current version uses min and max quantization values, which is a lower-level mechanism for configuring the encoder quality.
In comparison, if I use the AVIF compression implementation offered on XnviewMP image viewer with the same parameters (4-4-2, lossy alpha, 80-mark quality) the compression is around 8% from JPEG's original size!
What version of XNViewMP are you using? Version 1.3.1 does not have a quality slider for AVIF, its save UI options only provide the min and max quantization values that I mentioned above.
Do you expect avif-format will show significantly different image results at the same quality with that updated library?
Do you expect avif-format will show significantly different image results at the same quality with that updated library?
I do not. It appears that the new libavif code uses the same quantization values and quality range mapping algorithm as libheif. But libavif users will have to update their code to take advantage of the new option.
Also, despite what the save UI I posted above shows. XNViewMP v1.3.1 discards all image metadata when saving as AVIF. If the image has any metadata it will show a second dialog after clicking OK in the save options that warns about that.
Nice, thanks!
What's the benefit of that new option, smaller size at same quality?
What's the benefit of that new option, smaller size at same quality?
It is much more user friendly, as I mentioned in a previous post the min and max quantization values are lower-level options.
I still think that it would be difficult to compare the same AVIF encoder settings between implementations.
For example, my Paint.NET AVIF plugin configures its quality setting using a different method than either libavif or libheif. I will have to investigate and see if the technique used by libavif and libheif offers any advantages over the method that plugin is currently using.
Friendly for the dev? I'm just thinking about your interface, which has just the quality slider and is pretty simple. I'm assuming you mean quantization settings you set in your code but don't expose in your UI.
I'm assuming you mean quantization settings you set in your code but don't expose in your UI.
I was referring to the fact that developers and users of libavif will not longer have to deal with the quantization settings. See the XNViewMP screenshot I posted above for an example of how user-hostile the quantization settings are, I do not have any idea what values I would use to approximate 80% on a quality slider.
Gotcha, thanks.
What version of XNViewMP are you using? Version 1.3.1 does not have a quality slider for AVIF, its save UI options only provide the min and max quantization values that I mentioned above.
Sorry for the late reply.
I used version 1.3 for that - with, you're right, no quality settings whatsoever, so my mistake (I may have got it mixed up in my mind regarding such settings with some WebP settings I was fiddling with).
I made the same mistake with the XNViewMP JPEG quality settings.
Closing this issue as it is not a bug in the plugin.
Upon saving some photos directly from a JPEG file as AVIF on Photoshop CC 2014, the compression ratio I got is, if not too close to WebP's, worse than it.
In comparison, if I use the AVIF compression implementation offered on XnviewMP image viewer with the same parameters (4-4-2, lossy alpha, 80-mark quality) the compression is around 8% from JPEG's original size! WebP in comparison, yields around 50% or more - way more in accordance to the expected difference in compression between these two formats.