Replies: 2 comments
-
Hello @GrandArth, libvips expects device space plus an ICC profile, or sRGB if there's no profile. If libheif is supplying some other kind of RGB, or perhaps not matching the profile device space, than that feels like a libheif bug to me. libvips has a lot of support for colourspace transforms. You'd need to go to linear light (perhaps scRGB, if libheif is using the sRGB gamma), then perhaps through a 3x3 matrix to XYZ. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thx for your reply. this solved my question.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I been trying to intergrate libvips into my workflow lately, and i notice some colorspace mistransformation when transform to heic.
I think this is libheif related, but i am not sure is there a way we can set the transform matrix.
For example, in ffmpeg i can do
ffmpeg -i "$($FilePath)" -crf $CRTValue -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" -pix_fmt yuv420p -sws_flags spline+accurate_rnd+full_chroma_int -color_range 1 -colorspace 5 -color_primaries 5 -color_trc 6 -f hevc "$($FileNoExtensionPath).hvc";
to convert sRGB pics to YUV420 with right color. (which is the only option for windows heic decoder).
With
vips heifsave
i can't find similiar method, and the convertion is ... not exactly correct, as i demonstrated with a screenshot on a Chinese streaming service.ORIGINAL:
![1](https://user-images.githubusercontent.com/30680793/88507478-15613380-d00f-11ea-8fbc-23a174c8b257.png)
FFMPEG VER:
![图片](https://user-images.githubusercontent.com/30680793/88507502-26aa4000-d00f-11ea-96a0-e7d2918c007c.png)
VIPS VER
![图片](https://user-images.githubusercontent.com/30680793/88507518-2f9b1180-d00f-11ea-85d6-47f72d7ef3a1.png)
As you can probably see, there is an obvious "fading" on high lumination area.
This probably caused by wrong transformation matrix.
Screenshots.zip
Beta Was this translation helpful? Give feedback.
All reactions