fix(exposure): stop double-correcting primaries on Slide with an Input ICC - #994
Merged
marcinz606 merged 2 commits intoAug 29, 2026
Merged
Conversation
…t ICC E6/Slide with Normalize off already applies the raw's embedded camera matrix; Soft Proof and export then applied a custom Input ICC's matrix on top of that, correcting primaries twice. An active Input ICC now replaces the embedded matrix instead of stacking with it, matching how negatives already behave and how narrowband's bundled profile is suppressed the same way. Fixes marcinz606#991
…amera matrix The transfer-path decode always skips as-shot white balance and relies on camera_to_working_matrix's camera_wb fold to reconstruct it. Nulling cam_xyz outright for an active Input ICC dropped that fold too, so the buffer reaching the ICC's primaries-only matrix was still raw and unbalanced, rendering green. wb_only_cam_xyz stands cam_xyz in with a value that keeps the fold but degenerates the camera's own primaries rotation to identity, since the ICC supplies its own.
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
Fixes #991. On Slide/E-6 with Normalize off and a custom Input ICC set,
primaries were corrected twice: the render always applies the raw's
own embedded camera matrix on this path, and Soft Proof / export then
applied the Input ICC's own matrix on top of that — producing the
wrong color cast reported in #991, in both the preview and (worse)
every export, regardless of whether Soft Proof was ever toggled on.
An active Input ICC now stands in for the camera's own primaries
matrix instead of stacking with it, matching how negatives already
behave (no built-in matrix there — Input ICC is the only correction)
and the existing precedent for narrowband's bundled profile, which is
suppressed on a slide the same way: an explicit Input ICC is a
deliberate choice about the user's own source and wins.
The one subtlety: the transfer-path decode always skips the as-shot
white balance and relies on
camera_to_working_matrix'scamera_wbfold to reconstruct it, so simply nulling the camera matrix outright
also silently dropped that fold, leaving a raw, unbalanced buffer for
the ICC's matrix to (mis)correct.
wb_only_cam_xyzstandscam_xyzin with a value that keeps the fold but collapses the camera's own
primaries rotation to identity, since the ICC supplies its own.
Credit to @radioproektor for the original report and for the
"Normalize fixes it" observation, which was the actual diagnostic key
(turning Normalize on stops the camera matrix from applying at all, so
only the Input ICC correction runs, once).
Test plan
make all(lint + type + full test suite) passesthe controller (preview) and export boundaries
[Bug]: When Soft Proof enabled, Slide preview in NegPy has wrong colors and don't match to ICC profile. #991: Normalize-off export with the ICC set now matches the
no-ICC render (was a strong green cast; R,G,B channel means now
agree within noise), on both the CPU and GPU paths