Skip to content

Heic color management#6

Merged
laurenspriem merged 4 commits into
ente:mainfrom
laurens-pilot:heic_color_management
Jul 9, 2026
Merged

Heic color management#6
laurenspriem merged 4 commits into
ente:mainfrom
laurens-pilot:heic_color_management

Conversation

@laurens-pilot

Copy link
Copy Markdown

No description provided.

A grid primary now inherits the ICC and nclx profiles from its first
tile independently, treating the all-"unspecified" nclx sentinel
(2/2/2, full range) as absent on either side, matching libheif's
context.cc grid inheritance and pixelimage.cc:has_nclx_color_profile.
A grid whose first tile cannot be resolved keeps the primary item's
own colour properties instead of dropping them.

Behavioural note: primary_heic_color_properties no longer returns the
undefined nclx sentinel from the grid path; the non-grid path is
unchanged. Adds NclxColorProfile::is_undefined for the sentinel check.
The cicp tag now describes the decoded full-range RGB output (identity
matrix coefficients, full-range flag) instead of copying the stream's
YCbCr coding values, and an exotic stream matrix no longer aborts
synthesis. Profiles gain the ICC-required desc/wtpt/cprt tags and the
canonical D50 PCS illuminant; both text strings keep an even UTF-16
length because moxcms writes tags unpadded and ICC mandates 4-byte tag
alignment.

The four H.273 transfer codes sharing the BT.709 OETF (1, 6, 14, 15)
are aliased to sRGB (13) at synthesis time: still-image pipelines
render that OETF as sRGB (Apple ColorSync aliases nclx transfer 1 to
sRGB while honouring genuinely different curves), and a literal
709-curve profile measured brighter in lcms-class viewers and darker
on Apple than the source image. PQ/HLG/gamma/linear transfers keep
their correct curves; decoded pixels are unchanged throughout.

Known limitation: moxcms stamps the profile creation time at encode,
so synthesized-profile outputs are not byte-reproducible across runs.
@laurenspriem laurenspriem merged commit 547e514 into ente:main Jul 9, 2026
1 check passed
@laurens-pilot laurens-pilot deleted the heic_color_management branch July 9, 2026 04:42
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.

2 participants