Closed s7habo closed 4 months ago
I guess you are aware of the analyse radius button? You will have false colors for parts that can be changed in bright read and that wont be changed in dark blue ...
The color maths including the guided filter have not changed for "some time" - still looking for examples where it fails as in this image...
I guess you are aware of the analyse radius button? You will have false colors for parts that can be changed in bright read and that wont be changed in dark blue ...
Yes, I am aware of that. For the example above, it looks like this:
Moving the slider does not cause any change and has no effect on the result, regardless of whether the guided filter is switched on or off.
Moving the slider does not cause any change and has no effect on the result, regardless of whether the guided filter is switched on or off.
Right. Right now it just displays the weighing mask. We still have not found a "perfect" solution as we clearly see here, often in the green tones ...
It works well for saturation. However, there is a big difference between switching the guided filter on and off.
GF off:
GF on:
By the way, the raw file above is from https://www.signatureedits.com/free-raw-photos/
Simply scroll down until it appears or enter "DSC02363" in the search field and then it will be selected and can be downloaded
Yes while recent changes improved the result a lot it is still not perfect, with light colours and in particular green.
Saturation:
Brightness:
@s7habo i certainly have the described problem "on radar".
Atm we have
I would love to collect all known issues with this module before starting a new iteration of work on module maths. Are you - or is anybody else - aware of other issues?
Are you - or is anybody else - aware of other issues?
Yes, there is one that immediately comes to mind.
With smooth transitions, guided filter with brightness and saturation function produces banding:
With GF:
Without GF:
Hue function works correctly:
I am currently testing the module in more detail. If I notice anything, I'll let you know straight away.
Hi, #16363 will fix most issues as far as I can oversee it - tested on many images you provided and others. Let's keep track of problems here after that gets merged. It should work much better for all colorful areas, dark and bright.
Beside whatever issues you'll report, I am working on suppression of halos and increased chroma noise.
Weighing function is now super!
The problems with bending are also gone. :clap: :+1:
The only thing that is still weak is the problem with green:
But what works very well now is the analysis radius and the guided filter. :rocket:
I have now tried a lot of photos, and now I'm not sure if it's because of green.
When I compare the masks between the saturation and brightness functions, two things stand out:
Here are a few examples for comparison.
Saturation mask:
Brightness mask:
Org:
Saturation mask:
Org:
Saturation mask:
Brightness mask:
I would like to emphasize, the 'mask" you see is not a mask, it's the result of what the module has been doing.
About the stronger effect on brightness, that could be changed without problems. There are some remaining halos and minor problems with chroma noise, I would like to sort that out before extending brightness correction range.
In any case, thank you very much for your efforts!
Once this little rest of the problems are cleaned up, this will be a new milestone in image processing with darktable.
Saturation is now perfect!
And brightness has improved:
now I'm not sure if it's because of green.
Yes it seems to me now that lightness is the main determining factor. The colours that go to black quickest are those that appear darkest to begin with (red > blue). Of course I am of no help in determining the cause. Great work again @jenshannoschwalm!
@s7habo i have renamed the title of this issue to keep attention on this, ok?
@s7habo @SoupyGit i think i don't get "what exactly is the brightness issue" :-)
The module works in UC22-HSB space so the brightness - and also it's correction - is not linear, the visualizing mask shows changes in linear space though. Do you/we want more range for brightness correction? Or elaborate please ...
i have renamed the title of this issue to keep attention on this, ok?
Yes, thanks!
Or elaborate please ...
Brightness function seems to follow a kind of "s" curve. This means that in an area with the same color but different brightness, the contrast is increased.
To illustrate, the brightness function follows...
... a curve like this:
If this were a linear function, you would have something like this:
And that's what you would have expected as a user.
And because that's not the case...
Do you/we want more range for brightness correction?
...the answer is definitely yes, but how much depends on how/if this relates to increasing the contrast.
Aah, got it. Indeed the brightness correction follows the s-shaped weighing curve in a slightly different way atm, you need more saturation to have any change in brightness. Knowing that and working on it.
Indeed the brightness correction follows the s-shaped weighing curve in a slightly different way atm, you need more saturation to have any change in brightness. Knowing that and working on it.
By the way, what just came to my mind, if you are already working on the solution, this kind of contrast that we now have as a "problem" could be very useful in some situations. How would it be - if it turns out to be possible in your investigation - to control this dynamically?
Like a kind of additional slider for brightness function with which you can go from "brightness with strong dependence on saturation" to "brightness with low dependence on saturation", with which the contrast becomes stronger or weaker accordingly?
Just as an idea. :grinning:
Yes that could be done. I take your word about usability VS user interface here. So make up your mind, yes or no :-)
So make up your mind, yes or no :-)
I say yes and am immediately on the hunt for a good example. :point_up:
Here is one:
Before:
After:
Visualization:
And now I know why I thought of that. We had the discussion here about Fuji color chrome effect:
https://discuss.pixls.us/t/what-is-color-chrome-effect-and-how-to-achieve-it/18760/6?u=s7habo
Roughly speaking, this effect darkens the intense color areas to create an additional contrast that is lost with strong saturation.
Here are two more examples:
Note how the texture of the leaves is enhanced here:
Before:
After:
Here the car gets nice contrasts:
Before:
After:
I have one more idea that I would like to get rid of and then I'll stop because it belongs in the feature request section:
If you can have the same weight slider by saturation also for the saturation function itself (stronger saturation for already saturated colors vs. even saturation) you would also have what "vibrance" function does in color balance rgb module.
This would give both saturation and brightness functions an additional - let's call it - "vibrance" slider. I can imagine a lot of possible uses for this. But we can talk about that later.
Excellent work @jenshannoschwalm ! With your latest contribution, the color equalizer is slowly becoming the Swiss army knife for dealing with colors. :)
Here's an example right away:
In this photo...
...we wanted to darken the skin. With a very low effect radius, however, the skin looks very rough:
To counter this, we now increase the effect radius. The skin now looks nice, but the fur on the hat has lost its local contrast:
If we now also increase saturation threshold to increase saturation restriction, the fur of the cap regains its local contrast because it is excluded from the darkening. Face has more contrast and the neck is cleanly separated from the environment, which also prevents haloing of guided filter. This is really a very nice additional control:
The new saturation threshold function is a huge improvement in my opinion!
I have two questions in this regard.
The new saturation threshold function is a huge improvement in my opinion!
In this specific example I suppose that one could have been used a parametric mask on saturation.
In this specific example I suppose that one could have been used a parametric mask on saturation.
Unfortunately not. That was the first thing I tried to compare. This is the best I could achieve with the parametric mask based on saturation:
If you want to exclude the fur, you lose the area around the neck:
And this is what the visualization of the saturation threshold in color equalizer looks like (red is what is affected):
And this is the visualization of the effect radius. This gives the result a natural contrast:
Of course, you could also achieve this with additional masking. But if you have immediate control with a slider, that's actually great.
But I have to test it more intensively to see how it behaves with other examples.
I have two questions in this regard.
1. The slider is limited to -/+ 10% Can the radius of action be increased to -/+30% or more? Or one leave it as it is, but offer the possibility to enter higher (or lower) values via keyboard if necessary. 2. The transitions between saturated and non-saturated areas are a bit harsh. Could this also be controlled somehow with the guided filter?
Ad 1. Yes, although the percent value is not technically correct. With current code we can set the saturation threshold to values between 0 and ~25% (at 0 we have the default) I just thought this range would be sufficient :-) Let me know after further testing if this should be expanded, i wouldn't expect any problems from changing this.
Ad 2. Principally yes. The current weighing function is pretty steep around the threshold giving a good on/off effect. We could do that smoother of course but we reduce control of "colors should not bleed into achromatic areas" which was pretty bad in the original code. That would require an additional slider again ... something i would not like too much.
So, yes - both things could be done without big problems. As you compile yourself you might try this:
Ad 1: See line 102, change this to
float threshold; // $MIN: -0.1 $MAX: 0.2 $DEFAULT: 0.0 $DESCRIPTION: "saturation threshold"
Ad 2: Line 356, change the -60.0 to -30.0 for a smoother transition.
satweights[i+SATSIZE] = (float)(1.0 / (1.0 + exp(-60.0 * val)));
So, yes - both things could be done without big problems. As you compile yourself you might try this:
Unfortunately, I'm not that good. I only compile master version according to idiot-proof instructions for Ubuntu which I just blindly follow. :)
As for the first point, I'm already pretty sure that the range can be extended.
As for the second point, if it requires a new slider, I will also say that we don't need to overdo it. It makes sense to wait and see.
And now, after the https://github.com/darktable-org/darktable/pull/16415 :
"Barbie doll" (saturation threshold -10%) vs. natural saturation gradient in the face (saturation threshold + 18%):
Uniform (saturation threshold -10%) vs. "Kodachrome 64" saturation distribution (saturation threshold + 18%):
I can well imagine that analog film fanatics will now be very happy and a lot of presets will be circulating in the forums when the new darktable version comes out. :)
And for me it's now time for extensive testing.
Thank you @jenshannoschwalm !
And for me it's now time for extensive testing.
Waiting for feedback :-)
@s7habo :
I can well imagine that analog film fanatics will now be very happy and a lot of presets
Speaking of presets, if during your testing you have some nice (and generic) one to share do not hesitate, I'll be happy to integrate them.
Speaking of presets, if during your testing you have some nice (and generic) one to share do not hesitate, I'll be happy to integrate them.
colorequal_Kodachrome 64 like .dtpreset.zip
The preset is made according to the "Kodachrome 64" LUT from the RawTherapee collection here:
http://rawtherapee.com/shared/HaldCLUT.zip
In the collection is also the generic version, but this version requires additionally the shift of the white point in highlights towards magenta, which is not possible with CE module.
The preset works best in combination with the "smooth" preset in sigmoid, but can also be used with filmic.
The overall saturation can be adjusted with the color balance rgb module if required. However, I recommend reducing the saturation in highlights as this allows you to achieve the natural saturation distribution that also occurs in LUT.
Here are a few examples (original on the left, "Kodachrome 64 like" preset on the right):
I will offer some other presets soon.
colorequal_Kodak portra 400 like.dtpreset.zip
This preset is based on "Kodak Portra 400 UC1" from HaldCLUT collection and provides a nice color balance for most photos.
The subtle separation of cold and warm tones (shifting green and blue towards cyan and red and yellow towards orange) gives a good color contrast on the one hand and a nice color gradient for skin tones on the other.
This preset expects the saturation in general most in mid tones. Accordingly, the saturation in shadows and highlights should be reduced slightly with color balance rgb.
Here are a few examples (original on the left, "Kodak portra 400 like" preset on the right):
Very exploited but still very popular color style. You can use it like this or adjust its intensity with the opacity slider.
Here are a few examples (original on the left, Orange & Teal" preset on the right):
A visual effect used primarily in the film industry in which the bleaching process is partially or completely skipped during color film processing.
A famous example is the film "Saving Private Ryan" by Spielberg.
The result is a de-saturated and high-contrast photo that is on the verge of black and white, which shifts the focus to the form without completely sacrificing the color:
Due to the fact that the colors are not very dominant, a very nice color mood can be achieved by additionally changing the global color tone with global offset in color balance rgb module:
@jenshannoschwalm what i noticed is that saturation threshold goes from -10% to +20%. why not from -20% to +20%. If this also affects the de-saturated areas that could also be an advantage.
So, if there are no technical concerns, it would be interesting to know how the module behaves when the saturation threshold goes below -10%. :)
By the way, after working with the module for a while now, it works very well.
The range of -10% to 20% is fully sufficient as the saturation threshold is relative to default resulting in saturation inflection points between -0.05 to 0.6. (You can see the curve via the masking buttons as you know)
@s7habo @TurboGit: We might concider though: Currently we use a non-linear scale for threshold and could redefine the threshold slider
With today's master, is there still need for the guiding filter toggle on/off?
With today's master, is there still need for the guiding filter toggle on/off?
I will suggest a few days of testing and then we can decide. I would like to try it out on some photos first.
In any case, the latest version is great! Good work @jenshannoschwalm ! And also many thanks for the quick integration into the master @TurboGit !
@TurboGit @s7habo again, do we still need the guiding toggle button?
@jenshannoschwalm : I need more time to have a definite answer, I don't have used it enough at this point. What I can say is that for now I have always activated the guiding filter.
@jenshannoschwalm: I use color equalizer often and always turn it on and off to see the differences. With some photos there are indeed differences. These are usually the differences in the sharpness of the image when the guided filter is switched on. I would also like to play with it a little longer.
Okidoki
I'll close this at this time. We'll reopen separate issues if needed.
Describe the bug
I don't know if it's because of the recent changes in the module, or I've found a specific example, but the brightness again seems to be very much dependent on the saturation.
In this example I want to darken the green:
If I do this with the guided filter turned on, I get this result:
Note that a very large area was simply not taken into account. It is not much better if you switch off the guided filter:
The mask also clearly shows that saturation (and brightness?) oriented selection:
The result looks much better if you correct the saturation beforehand with the color balance RGB module. Note that I have adjusted the saturation here so that I have saturated the highlights the most, the midtones much less and I even had to reduce the saturation for shadows. Then you get the result as I would expect:
In this way, the result comes pretty close to the result if you mask the green with the exposure module and darken it:
EDIT: Just as a thought, could it be that the brightness function depends on the saturation (purity) and on the original brightness of the area? This means that not only the saturated areas, but also the darker areas are affected much more than the brighter ones?
Steps to reproduce
Expected behavior
The affected area should be lightened/darkened evenly regardless of the original brightness/saturation of the area.
Logfile | Screenshot | Screencast
No response
Commit
No response
Where did you obtain darktable from?
self compiled
darktable version
4.7.0+611~g76e4f8a6c
What OS are you using?
Linux
What is the version of your OS?
Ubuntu Studio 22.04
Describe your system?
KDE Plasma Version: 5.24.7 KDE Frameworks Version: 5.92.0 Qt Version: 5.15.3 Kernel Version: 5.19.0-1028-lowlatency (64-bit) Graphics Platform: X11 Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz Memory: 31.3 GiB of RAM
Are you using OpenCL GPU in darktable?
Yes
If yes, what is the GPU card and driver?
Graphics Processor: NVIDIA GeForce GTX 1070/PCIe/SSE2 Driver: 535.154.05
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response