fix(colors): hlg inverse transfer function missing ootf component #387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, tev implemented HLG's inverse transfer function as just the inverse OETF, which produces scene-referred relative brightnesses that are technically fine to use. OpenEXR also is scene-referred relative. However, HLG mandates a specific extra step (its OOTF) in how scene-referred values should be converted to the colors that are rendered (absolute, display-referred brightness) -- and it would be annoying to weave this extra step later into tev's rendering pipeline. Rather, tev now applies the OOTF on load of HLG images and treats the resulting colors as display-referred (like PQ and other transfers).
This brings tev's rendering of HLG images in line with other software that can display them (e.g. macOS Preview and Chrome).
A little bit of refactoring was needed for this fix, because, unlike all other transfer functions, HLG's OOTF depends on all color channels rather than being per-component.
Worth noting that I have not found a single HLG-formatted image in the wild, other than one in this test image collection.