Skip to content
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

nclx: use default values that match sRGB #1015

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

kleisauke
Copy link
Contributor

Since commit 062b528, libheif saves images with the default NCLX profile 6,6,6 (Rec. 601 aka NTSC) which is pretty far from sRGB and leads to incorrect colors in most viewers. Additionally, the colr HEIF box wasn't updated to reflect this.

Commit 673fb03 resolves the latter issue by guaranteeing the update of target_nclx_profile following the color conversion, thereby ensuring the propagation of any defaults specified in ColorConversionPipeline::convert_image().

Commit 3bc7572 resolves the former issue by ensuring NCLX profiles defaults to 1,13,1 (Rec. 709 with IEC 61966-2-1 transfer function).

Context: libvips/libvips#3731

Thanks to @DarthSim for discovering this.

@novomesk
Copy link

I agree that NCLX with unspecified 2/2/2 should not be interpreted as 6/6/6.

I understand that default interpretation should be sRGB but I believe it should be 1/13/6 and not 1/13/1. (BTW I also use 1/13/1 in my software but it must be explicitly set that way).

I think it is OK to leave initial NCLX values to 2/2/6 - matrix coefficients is good to define, but primaries and transfer function could be defined via ICC.

libheif/context.cc Outdated Show resolved Hide resolved
farindk added a commit that referenced this pull request Oct 30, 2023
@farindk
Copy link
Contributor

farindk commented Oct 30, 2023

I've implemented the handling of unspecified values in a different way that avoids overwriting the target_nclx_profile in de41052.
Combined with your changes of the default values, I think this should solve the problem.

@farindk farindk merged commit 8cacd4d into strukturag:master Oct 30, 2023
29 of 30 checks passed
farindk added a commit that referenced this pull request Oct 30, 2023
@kleisauke
Copy link
Contributor Author

Thanks! I can confirm that PR #1017 resolves this.

@kleisauke kleisauke deleted the srgb-default branch October 30, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants