Apply hue and sat corrections for some DNG files - #22503
Draft
jenshannoschwalm wants to merge 2 commits into
Draft
jenshannoschwalm wants to merge 2 commits into
jenshannoschwalm wants to merge 2 commits into
Conversation
jenshannoschwalm
force-pushed
the
forward_get_look
branch
from
October 3, 2026 23:26
a5c3afc to
5539d4e
Compare
(1) exif: store embedded DNG look metadata in the image Read the illuminant-selected HueSatMap and profile tone curve into owned image fields. Validate table dimensions and element counts before allocating, and retain illuminant selection without a forward matrix. Initialize and release the tables with the image cache. Detach borrowed pointers during full-size loading, transfer successful loads, and free failed loads so metadata ownership stays with the current cache record. (2) iop: apply the DNG look after colorin Add a hidden look module enabled only when a valid forward matrix is selected as the input profile. Respect module filters and recorded history, and lock cache-owned metadata while copying it into the pipe. Blend the embedded tone curve and retain final clipping. Register the module after colorin and add focused unit coverage for interpolation, mixing, scale caps, profile gating, and cache snapshots. (3) colorin: consolidate DNG look profiles and synchronize enablement Keep embedded looks active with a valid selected DNG forward matrix, and offer an opt-in embedded-look profile for D65 images without one. Reuse the embedded matrix fallback chain while preserving the new type and propagate both camera matrices into the pipe profile information. Request full synchronization when profile selection crosses into or out of the look-capable set, so top-history edits update the look on every pipe. Cover availability, fallback matrices, processing, and repeated profile switches with unit tests. Co-authored-by: jenshannoschwalm <50982232+jenshannoschwalm@users.noreply.github.com> tests: align DNG look tests with required working profiles Co-authored-by: jenshannoschwalm <50982232+jenshannoschwalm@users.noreply.github.com>
Summary: Introduce a hidden dng_look module that makes use of the dng exif data provided via `ProfileHueSatMapData` and corrects hue and saturation accordingly. As we use tonemappers like agx or sigmoid we do not apply any value/brightness correction here. (For the same reason we do not use `ProfileToneCurve`) Some images have no forward matrix but offer `ProfileHueSatMapData`, those images use the embedded D65 coeffs but may use the dng_look if the special color profile `DNG embedded look` is used in colorin module. Design decisions: 1. Not worth to implement an OpenCL codepath to maintain. 2. All things done in dng_look could also be done in colorin processing but that would have blown up that module even more. Minor code optimizing - without a working profile it doesn't make sense to use this module ...
jenshannoschwalm
force-pushed
the
forward_get_look
branch
from
October 4, 2026 00:03
5539d4e to
62f807d
Compare
jenshannoschwalm
marked this pull request as draft
October 4, 2026 07:13
Collaborator
Author
|
Marking this as draft for now - reinvestigating if the correction should be done in colorin module. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Complete forward matrix support of DNG images and apply the saturation and hue correction as suggested by the DNG exif tags and support these corrections also if no forward matrix is provided.
Introduce a hidden
dng_lookmodule that makes use of the dng exif data provided viaProfileHueSatMapDataand corrects hue and saturation accordingly.As we use tonemappers like
agxorsigmoidwe do not apply any value/brightness correction here. (For the same reason we do not useProfileToneCurve)No changes to old edits (before the late forward matrix PR) no defaults changed.
Referenced issue
None specific
Checklist
src/tests/integration/- all good with no diffs._()RELEASE_NOTES.mdentry was addedTest instructions
Use any of the images here and check colorin profile
AI assistance
Not assisted but almost everything was written by claude sonnet