awxkee / avif-coder

AVIF/HEIC coder for Android, Kotlin, Java
MIT License
65 stars 7 forks source link

100% quality looks worse than 99% #18

Closed kremzli closed 8 months ago

kremzli commented 8 months ago

100% seems to smooth things out too much, also blockier

Examples (converted to png because github skill issue): See the wall, floor, arm, text also looks better in 99%

99% (173kb): IMG_2024-03-18_16-30-38_4431

100% (20kb): IMG_2024-03-18_16-30-57_1386

Related issue (with additional example) https://github.com/T8RIN/ImageToolbox/issues/891

awxkee commented 8 months ago

I'll look into it. However your meaning that You could remove 100% option because that would mean lossless and it isnt is wrong. AVIF and JXL as well have dedicated compression mode that mean loseless, quality 100 just max quality but not loseless. Also this library always embed AVIF with YUV 4:2:0 that cannot be loseless by itself due to chroma downsampling. Loseless AVIF's theoretically can be possible only for YUV 4:4:4 any other chroma format changes the chroma and this is already not loseless. I don't know exactly what YUV range does libheif use for chroma range, highly likely it's TV range Y ( 16 - 235 ), UV ( 16 - 240) not PC range ( 0 -255 ) and that would mean loseless AVIF cannot be achieved at all.

kremzli commented 8 months ago

Yes i meant removing 100% quality because the library doesnt do lossless

awxkee commented 8 months ago

Fixed