Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colorequal decouple brightness #16218

Merged

Conversation

jenshannoschwalm
Copy link
Collaborator

Currently we process all three correction parameters with the same gaussian blur in one 4-channel group.

We might want to process the brightness correction in a different way so that has been split and we have to blur twice for each group of correction.

Using the fast "expf" variant gives a huge performance gain without significant differences.

@jenshannoschwalm jenshannoschwalm added this to the 4.8 milestone Jan 30, 2024
@jenshannoschwalm jenshannoschwalm added scope: image processing correcting pixels scope: performance doing everything the same but faster scope: codebase making darktable source code easier to manage labels Jan 30, 2024
@jenshannoschwalm
Copy link
Collaborator Author

jenshannoschwalm commented Jan 31, 2024

@TurboGit not sure if we want the third commit merged into master, it certainly helps to understand "what goes wrong" with current code.
EDIT: made the mask visualizing thing a compile-time option.

@jenshannoschwalm jenshannoschwalm force-pushed the colorequal_decouple_brightness branch from ffc2331 to e9e71a6 Compare January 31, 2024 06:34
@TurboGit
Copy link
Member

We might want to process the brightness correction in a different way so that has been split and we have to blur twice for each group of correction.

Reading this do I understand correctly that this PR is 100% equivalent to current master (expect for fast expf)? I'm asking because even if using expf I see big differences in the output, but maybe that's due to the bilinear interpolation being done in 2 steps.

We likely require blurring the brightness correction to be independent of
the chroma corrections.
Improves performance a lot.
Due to definition of `dt_fast_expf()` there is a significant error but that is not significant
for what we do here. (Might change this later to some lookup table for performance)
At least while we work on the brightness corrections in the guided filter we would like some
visualizing of "what happens".

Introduced a mask button after the effect radius slider.
If active it shows the "saturations" data plus false-color representation of brightness correction.
Shifts to red show increased brightness, to blue decreased brightness.
We should use the "size_allocate" signal to enforce a refresh of the background colors.
@jenshannoschwalm jenshannoschwalm force-pushed the colorequal_decouple_brightness branch from ea267be to d5466cc Compare January 31, 2024 18:49
@jenshannoschwalm
Copy link
Collaborator Author

There was a blurring sigma change. Fixed. Should be ok now...

Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now, thanks.

With fast_expf:

      Expected CPU vs. current CPU report :
      ----------------------------------
      Max dE                   : 1.42615
      Avg dE                   : 0.03530
      Std dE                   : 0.13232
      ----------------------------------
      Pixels below avg + 0 std : 92.53 %
      Pixels below avg + 1 std : 92.75 %
      Pixels below avg + 3 std : 95.14 %
      Pixels below avg + 6 std : 99.60 %
      Pixels below avg + 9 std : 99.99 %
      ----------------------------------
      Pixels above tolerance   : 0.00 %

With expf:

      Expected CPU vs. current CPU report :
      ----------------------------------
      Max dE                   : 0.00000
      Avg dE                   : 0.00000
      Std dE                   : 0.00000
      ----------------------------------
      Pixels below avg + 0 std : 100.00 %
      Pixels below avg + 1 std : 100.00 %
      Pixels below avg + 3 std : 100.00 %
      Pixels below avg + 6 std : 100.00 %
      Pixels below avg + 9 std : 100.00 %
      ----------------------------------
      Pixels above tolerance   : 0.00 %

@TurboGit TurboGit merged commit 0abe95a into darktable-org:master Jan 31, 2024
5 checks passed
@jenshannoschwalm jenshannoschwalm deleted the colorequal_decouple_brightness branch April 17, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: codebase making darktable source code easier to manage scope: image processing correcting pixels scope: performance doing everything the same but faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants