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

Added a color finder tool #15707

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

geraldgattringer
Copy link

@geraldgattringer geraldgattringer commented Nov 22, 2023

Hi!

I have recently watched the fantastic video "Secrets of color-grading in photography" by Joanna Kustra (https://youtu.be/mC8ol2-V7Ck?feature=shared&t=3938) and noticed that around 1:05:38 she applies this neat trick to view only color without shades by luminosity blending the image with a neutral grey layer.
I reproduced this functionality in Darktable by adding a "color balance rgb" instance where the global saturation is set to 0 and the blend mode to divide.

To make this a bit more convinient I have added this functionality in a more convinient way through the press of a button next to the focus peaking, clipping overlay, etc. The target value and saturation amplification are settable with a right-click context menu similar to other overlays.

Why is this useful?
Sometimes (for example during creative color-grading) I find some hues in the vectorscope strike my interest ("Where exactly is this shade of purple..?"). Instead of hunting around with the color picket to find those hues, with this addition they can be found with the press of a button. The elimination of shades and reduction of the image to saturation and hue makes this process very easy.
It is also helpful when correcting color casts in shadows, defrinding, ..

Some comparison imges:

@TurboGit TurboGit self-requested a review November 22, 2023 21:36
@TurboGit TurboGit added the wip pull request in making, tests and feedback needed label Nov 22, 2023
@TurboGit TurboGit added this to the 4.8 milestone Nov 22, 2023
@TurboGit
Copy link
Member

On Windows the CI reports:

D:/a/darktable/darktable/src/src/common/color_finder.c
D:/a/darktable/darktable/src/src/common/color_finder.c:25:10: fatal error: bits/stdint-uintn.h: No such file or directory
   25 | #include <bits/stdint-uintn.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I have not checked the macOS failure.

@zisoft
Copy link
Collaborator

zisoft commented Nov 23, 2023

I have not checked the macOS failure.

Same failure on macOS

@victoryforce
Copy link
Collaborator

@geraldgattringer You should #include <stdint.h>, not <bits/stdint-uintn.h>

@TurboGit
Copy link
Member

If I'm not mistaken, this is the kind of view one gets when clicking c over the parametric mask hue slider, right?

@geraldgattringer
Copy link
Author

It is similar:
unalterd image

your method in a module with a JzCzhz parametric mask:

your method in a module with a LCh parametric mask:

this work (by default targets a neutral grey and saturation is unaltered):

this work with value target 255:

this work with value target 255 and saturation amplified 2x

@difrkaguilar
Copy link

difrkaguilar commented Nov 29, 2023

This type of visualization, if it were to be implemented, would have to be independent of the way the program works by modules, since this type of visualization is effective for making color corrections, creating harmonies and defining the dominant color in a photograph.

Some time ago I did some tests using the same watermark module by placing a gray plane at 18% on top and blending the layer by luminosity. Of course, this is of no use when the watermarks are practically at the end of the pipe, unless the order of the modules is changed to a custom one.

This is the example.

Screenshot from 2023-11-28 21-15-34

I also checked a video where a good explanation of the use of this method was given, but applied to Photoshop, as Joanna Kustra does.

This is the link to the video I am talking about.

https://www.youtube.com/watch?v=lnbPL4CvFvs

In a way this way of visualization is related to the post related to false color, which is also used among other things to adjust skin tones, exposure, etc. #15486

@geraldgattringer
Copy link
Author

@difrkaguilar The current implementation sits on top of the image pipe (so it is no a module) and applies the transformation just before an image is displayed. This is similar to the way the focus peaking view is implemented.

Currently the transformation is performed in HSV color space.
However, I think YCbCr works better than HSV for the intended purpose.
default saturation

more saturation

@difrkaguilar
Copy link

he current implementation sits on top of the image pipe (so it is no a module) and applies the transformation just before an image is displayed. This is similar to the way the focus peaking view is implemented.

Nice to know that. Hope to test it soon. Thanks.

@geraldgattringer
Copy link
Author

I just pushed a commit which changes this tool's working color space from HSV to a luma based one. As this is a visual tool I think the change from value to luma is justified.

Also in darktable.c in the button/slider callbacks i switched from dt_dev_reprocess_center() to dt_control_queue_redraw_center(). As this tool does not make changes to the pipe and consequently there is no need for making the cache obsolte. Effectively this change makes it way more responsive. This change could probably also be made to the focus peaking tool.

@difrkaguilar I like that the color palette is displayed in on of issue #15486's examples. Maybe it could be useful to add the color palette of the currently displayed image. Perhaps next to the vectorscope.. I'll try to make a prototype.

@TurboGit
Copy link
Member

TurboGit commented Feb 2, 2024

@geraldgattringer : This is still marked as Draft, what the status? Do you plan on finalizing this?

@geraldgattringer
Copy link
Author

Yes!
Sorry for the inactivity. I did not find much time lately. I experimented with color palettes (as mentioned above) a bit but deemed it not really usefull / a solution looking for a problem.

I'll try to finish it by the end of this week.

@TurboGit
Copy link
Member

@geraldgattringer : The feature freeze is on May 15th. Do you think you can finalize it by then or should I postpone for 5.0? Let me know, thanks!

@TurboGit
Copy link
Member

Moving to 5.0 as we are now in feature freeze for 4.8.

@TurboGit TurboGit modified the milestones: 4.8, 5.0 May 16, 2024
@TurboGit TurboGit modified the milestones: 5.0, 5.2 Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip pull request in making, tests and feedback needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants