iop/basecurve: add ACES-like modes, JzAzBz saturation and gamut mapping#20320
Open
Christian-Bouhon wants to merge 10 commits intodarktable-org:masterfrom
Open
iop/basecurve: add ACES-like modes, JzAzBz saturation and gamut mapping#20320Christian-Bouhon wants to merge 10 commits intodarktable-org:masterfrom
Christian-Bouhon wants to merge 10 commits intodarktable-org:masterfrom
Conversation
For readability and maintenance this returns a valid OpenCL error code instead of a gboolean. Some error codes fixed.
As parameters for OpenCK kernels must be presented as 'pointer-to-value' we use compound literals for readability.
- kernels called with the _args() variant - a missing mem allocation check added - using CLARGFLOAT
- deduplicated code for atomic floats to common.h preparation for better support also for modern devices instead of that workaround - use _args() variants for kernel calls in bilateral - constify in both related kernels
1. All non-local OpenCL kernel calls use _args() interface 2. new kernels as asked for by @ralfbrown (code does not work) - eaw_zero - eaw_addbuffers
1. All non-local OpenCL kernel calls now use the _args() variant 2. Deduplicated code for old/new variant (still using "old" code 3. Fixed some possible clmem-leaks if kernels would fail
As the tiling factor_cl for blendop might be less than the overall now we have to mix properly. This often avoids 1x1 OpenCL tiling in the pipe for blended modules.
As we need to use it0 (selected->data) later don't mess with it. We do a copy before checking for first/last item. Closes darktable-org#20290.
dbc808d to
4a6dfb5
Compare
Author
|
I just saw that you've been working on the project. Sorry if my last push overwrote some of your maintenance fixes. I've finalised the implementation of the JzAzBz adaptive shoulder extension and CPU/GPU parity. The mathematical logic is now complete on my end. |
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.