-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output .avif image is washed out #7308
Comments
The same thing happens when we run And next time there is no need to create an issue when there is already an active discussion. |
It's more likely the fact that IM is assuming sRGB when reading/converting images. The original is in the CICP 9/16/9 color space (BT.2020 color primaries and D65 white w/ PQ transfer curve). Btw, "RGB colorspace" doesn't mean anything to me, except there are three (undefined) components. Which "RGB"? Primaries? White point? Transfer curve? |
There is an api that allows us to read the image in |
What you see above is not a YCbCr image - the channels are correct (green is still "some" green, blue is still "some" blue, etc.), just that the primaries and the transfer function are not mapped correctly.
libavif/libheif don't have an API to do any "color space" conversion. They can only change format from YCbCr to RGB in the original image color space (BT.2020 + PQ in this case), it is up to clients to do color management. You're not getting an sRGB image automagically upon reading. |
Another part of the problem could be that here: Line 164 in 738d434
you assume there will be an ICC profile embedded in the image, but AVIF/HEIF images can also encode their color profile as the CICP tuple only (
so I guess this gets ignored by IM?
See also #6642 |
Also, CICP is now part of the PNG specification as well as an alternative to ICC, so you might want to consider supporting it in some way throughout (e.g. throw a warning if detected as minimum). AFAIK, only libjxl will do an on-the-fly conversion of its internal color profile encoding to ICC... |
ImageMagick version
7.1.1-32
Operating system
Linux
Operating system, version and so on
Ubuntu 24.04 LTS x86_64
Description
The screenshot below is comparison of original
hdr.avif
(left) andout.avif
(right).As you can see, the ouput file
out.avif
is washed out, which is not desired.Steps to Reproduce
hdr.avif
magick hdr.avif -resize 50% out.avif
Version 124.0.6367.158 (Official Build) (64-bit)
(Any version above v85 should also produce the same result).Images
avif.zip
(This .zip file contains original
hdr.avif
and outputout.avif
)The text was updated successfully, but these errors were encountered: