Skip to content

Signal sRGB correctly in HEIF and AVIF NCLX profiles - #458

Open
gregbenz wants to merge 1 commit into
google:mainfrom
gregbenz:codex/correct-srgb-nclx-signaling
Open

Signal sRGB correctly in HEIF and AVIF NCLX profiles#458
gregbenz wants to merge 1 commit into
google:mainfrom
gregbenz:codex/correct-srgb-nclx-signaling

Conversation

@gregbenz

Copy link
Copy Markdown
Contributor

Signal sRGB correctly in HEIF and AVIF NCLX profiles

Summary

  • signal IEC 61966-2-1 for sRGB primary images in HEIF and AVIF output
  • continue interpreting the BT.709 transfer value written by older libultrahdr versions as sRGB
  • verify the serialized primary-image NCLX profile for both codecs

Why

The HEIF/AVIF encoding APIs require the SDR intent to use UHDR_CT_SRGB, but the output NCLX profile currently identifies that transfer as BT.709. This conflicts with the sRGB pixel encoding and the sRGB ICC profile written by the same path.

Viewers that honor NCLX may therefore select the BT.709 inverse transfer function for sRGB values, producing incorrect linear-light values that are most noticeable in shadows. The encoded pixels are unchanged by this fix; only their transfer-characteristic signaling is corrected.

The decoder retains BT.709 as a legacy alias for sRGB so files written by existing libultrahdr releases remain compatible.

Testing

  • generated API-1 HEIF and AVIF images and inspected the serialized primary-image NCLX profiles
  • confirmed both tests report BT.709 before the fix and IEC 61966-2-1 afterward
  • complete unit suite passes

@google-cla

google-cla Bot commented Aug 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gregbenz
gregbenz marked this pull request as ready for review August 18, 2026 20:10
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.

1 participant