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

1.19 changed color profile for HEIC images without color profile #1417

Open
roticv opened this issue Nov 29, 2024 · 4 comments
Open

1.19 changed color profile for HEIC images without color profile #1417

roticv opened this issue Nov 29, 2024 · 4 comments

Comments

@roticv
Copy link
Contributor

roticv commented Nov 29, 2024

Firstly, I want to say that 1.19 improved HEIC decoding performance by at least 10%. However, upgrading from 1.17.6 -> 1.19.x, I have discovered that the color profile for HEIC images (without color profile via icc or nclx) change drastically. Comparing against macOS preview, the color profile for 1.17.6 is closer.

Is there a way to make the default closer to macOS preview? I checked the ISO/IEC 23008-12 and it doesn't seem to have information about the defaults (or my grep skills fail me).

Thanks.

Further details:
In 1.17.6, for HEIC images without color profile via icc or nclx, the following settings are used:

heif_matrix_coefficients_ITU_R_BT_470_6_System_B_G
heif_color_primaries_ITU_R_BT_470_6_System_B_G
heif_transfer_characteristic_ITU_R_BT_601_6

With 1.19.x, for HEIC images without color profile via icc or nclx, the following settings are used:

heif_transfer_characteristic_IEC_61966_2_1
heif_color_primaries_ITU_R_BT_709_5
heif_matrix_coefficients_ITU_R_BT_601_6

@farindk
Copy link
Contributor

farindk commented Nov 29, 2024

Example image? The profile could also be stored in the h265 bitstream.

@roticv
Copy link
Contributor Author

roticv commented Nov 29, 2024

Ignore the above message. I managed to upload an example heic with exhibits the issue
1_tile.heic.zip

@farindk
Copy link
Contributor

farindk commented Nov 30, 2024

Thank you for the image. Yes, I can confirm this.

The image does not have an nclx defined in the HEIF, but it has nclx information in the h265 bitstream, read by decoder_libde265.cc. The old code did an unnecessary conversion through RGB space, which helped to propagate the nclx to the output image, but the new code skips the conversion (which makes it faster). Unfortunately, it does not pass the nclx from the tile images to the grid image, which drops the nclx of the tile images.

I'll take care of that.

@roticv
Copy link
Contributor Author

roticv commented Nov 30, 2024

Thanks for the detailed explanation and it makes sense to me!

I'll take care of that.

Once again, thank you!

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

No branches or pull requests

2 participants