iop/basecurve: modernization, JzAzBz saturation, and gamut protection#20320
Draft
Christian-Bouhon wants to merge 3 commits intodarktable-org:masterfrom
Draft
iop/basecurve: modernization, JzAzBz saturation, and gamut protection#20320Christian-Bouhon wants to merge 3 commits intodarktable-org:masterfrom
Christian-Bouhon wants to merge 3 commits intodarktable-org:masterfrom
Conversation
This PR modernizes the basecurve module to better handle scene-referred workflows while maintaining strict backward compatibility. - Bump introspection to version 7. - UI Cleanup: removed hide graph and color balance. - New Feature: UCS Saturation Balance is now chroma-weighted (vibrance). - Legacy: Preserves exact behavior for existing edits.
This PR modernizes the basecurve module to improve its scene-referred capabilities while ensuring perfect backward compatibility for display-referred workflows. Key Improvements Scene-Referred Mode (ACES-like/Narkowicz): New Flow: Implements a perceptual tone mapping pipeline: Signal Analysis -> Matrix-based Looks -> Exposure Normalization -> Perceptual Tone Mapping -> RGB Reconstruction. Tone Mapping: Added ACES-like and Narkowicz perceptual models for better highlight roll-off and contrast control compared to standard curves. Looks: Added 3x3 RGB matrix-based 'Looks' (Portrait, Sky, etc.) with a mix slider. Color & Gamut Integrity: Perceptual Saturation (JzAzBz): Improved 'UCS saturation balance' to compress highlight saturation while boosting shadows for better visual density. Hue Correction: New color rotation slider with selective desaturation to eliminate common color drifts (skin tones, blues). Gamut Securing: Introduced a multi-space gamut engine (sRGB, Adobe RGB, Rec2020) and a specific Anti-Magenta Algorithm (Highlights Protection): Implementation of a selective highlight desaturation logic. When luminance exceeds the threshold (0.8), the compression factor is biased to be 10% stronger on the blue channel compared to red and green. Goal: This specifically targets the common 'magenta shift' in overexposed skies or artificial blue lights, ensuring they desaturate towards white rather than shifting hue. Ergonomics & Compatibility: Backward Compatibility: Display-referenced processing (classic mode) remains untouched. UI: Curve graph can now be resized with the mouse. Introspection: Bumped to version 7.
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.
This PR modernizes the basecurve module to improve its scene-referred capabilities while ensuring perfect backward compatibility for display-referred workflows.
Key Improvements
1. Scene-Referred Mode (ACES-like/Narkowicz):
◦ New Flow: Implements a perceptual tone mapping pipeline: Signal Analysis -> Matrix-based Looks -> Exposure Normalization -> Perceptual Tone Mapping -> RGB Reconstruction.
◦ Tone Mapping: Added ACES-like and Narkowicz perceptual models for better highlight roll-off and contrast control compared to standard curves.
◦ Looks: Added 3x3 RGB matrix-based "Looks" (Portrait, Sky, etc.) with a mix slider.
2. Color & Gamut Integrity:
◦ Perceptual Saturation (JzAzBz): Improved "UCS saturation balance" to compress highlight saturation while boosting shadows for better visual density.
◦ Hue Correction: New color rotation slider with selective desaturation to eliminate common color drifts (skin tones, blues).
◦ Gamut Securing: Introduced a multi-space gamut engine (sRGB, Adobe RGB, Rec2020) and a specific Anti-Magenta Algorithm (Highlights Protection): Implementation of a selective highlight desaturation logic. When luminance exceeds the threshold (0.8), the compression factor is biased to be 10% stronger on the blue channel compared to red and green.
◦ Goal: This specifically targets the common "magenta shift" in overexposed skies or artificial blue lights, ensuring they desaturate towards white rather than shifting hue.
3. Ergonomics & Compatibility:
◦ Backward Compatibility: Display-referenced processing (classic mode) remains untouched.
◦ UI: Curve graph can now be resized with the mouse.
◦ Introspection: Bumped to version 7.