Clarity in darktable

I am but a designer. Meaning I try to solve people’s problems.

Some people (like me) want a fine-grained control. They can tweak filmic ad nauseam, following the manual.

Some people want a semi-automatic way to process images. So they can use a preset, leave filmic as set, and bother about exposure.

Nothing is ever required. It’s all about matching intent and method.

AH, I knew it was possible somewhere :slight_smile: Thanks !

Yes, the channel mixer is a simple tool, at the foundation of image processing. It does exactly what the input color profile does : a matrix multiplication. As most simple operations, it is very powerful in terms of use. And yet, simple operation doesn’t mean simple to use. I don’t think you can escape some theory if you want to use it.

4 Likes

Disclaimer, before I start: I’ve messed with the dt filmic module just enough to know I need to go and watch @anon41087856’s videos… so, I do not have specific knowledge about how they work.

But, I do know the fundamental characteristics of a filmic curve, and to me that’s important to developing heuristics regarding its use. Essentially, it’s log-like, with a toe on the left end. You play with the toe to “crisp-up” the blacks, and you play with the shoulder and central linear line to mess with the overall tone distribution. In rawproc, my tone tool has a curve plot to show one what the selected tone operator and its parameters will do to the image, and I’ve found that to be of critical importance in applying it to particular images.

For instance, my test raw for rawproc is a scene with a specular highlight (locomotive headlamp), a mid-morning cumulus-cloudy sky mixed with locomotive steam and smoke, and a triple-headed train where the locomotives sport various shades of gray-to-black. When I scale the image to fit black-white where the headlight is blown (don’t yell at me @heckflosse, I’ll get around to figuring out librtprocess highlight recovery… :smiley:), it almost looks good as-is, linear. Indeed, when I put the basic filmic on it, the steam, smoke, and cloud definition gets lost in that rather lofty shoulder headed to white. Really, I’ve found that the best curve for this image is a custom curve with two control points: one on the exact center of the line, unmoved, and a lower one drug slightly below the neutral line to pull the shadows down a bit.

So, summed up, here’s what I think is important about any tone curve selection:

  1. know what linear looks like for the particular image, and,
  2. know the transform curve of whatever tone operator you apply to move from linear.

That’s it. log, log-gamma, reinhart, filmic, custom; same two fundamentals.

In the snowstorms around here, I had a few pictures outside the house. This is the first time I was missing some of Lightroom’s highlight controls :).

The problem was not getting the highlights within range or anything, filmic did it nicely. But to make the snow pop a bit more you need local contrast or something.

Local-contrast module didn’t seem to do it, or at least not enough from what I was searching for.

I ended up (after the normal white-balance, exposure, color calibration, filmic set) adding local-contrast, but in the bilateral mode. Turn the contrast all the way down, put the details quite high (too high for comfort) and adjust the coarseness this way till you think it right.

Then I add a parametric mask, enable the ‘mask-view’ mode and turn the L of the parametric section up till you only have the highlights selected. This way it only works on the highlights (snow) without affecting the rest of the image. Put the feather-radius and mask-blur up a bit so the mask has no sudden edges.

If the effect is too strong, turn the opacity of the mask down to control it in a smoother fashion.

With the contrast down I get no haloing whatsoever. At least not on the few pictures I took yesterday :).

1 Like

Yep, most tone curves are flat at the top, so high-key things like snow tend to suffer in contrast. The challenge is to make the tone curve slope at that point steeper, without goofing up adjacent areas’ contrast… That’s why I’m reverting to a control-point curve in some instances; no math to get in the way of that. :laughing:

@jorismak Try some dramatic shift in the contrast fulcrum in CB and play with contrast…sometimes you can hit it right and you can drive it in just the right place. Also subtract blend mode at a very low opacity say 5-15 % can have almost like a dehazing effect…I have not tried it on snow but on light outdoor pictures around water it bring a nice effect. I have gone as high as 25% but rarely and after that it will just get dark… I often apply it with just a strait tone curve or maybe a small tweak to the curve…

I set up a parametric mask as you describe and then apply a tone curve, pulling it down to increase contrast in the highlights. It works pretty well as long as I’m not too aggressive with it.

Actually, increasing the local contrast in new darktable is very simple. You have to make use of the blend modes. Especially good for this is multiply reverse blend mode.

Here is an example. This is the scene I just photographed from my window:

After white balance and exposure compensation it looks like this:

Actually already very nice, but the details in the snow are missing. These areas look very flat.

In filmic I compress the shadows and highlights a bit more to have more room in highlights. Since this reduces contrast, I reduce latitude and increase contrast in the “look” tab. This is what the photo looks like afterwards:

Now the photo is ready to increase the local contrast. For this I will use local contrast module with multiply reverse blend mode. First I choose the RGB (scene) option in the blending options tab:

LC4

Then I take multiply reverse as blend mode and in the module itself play with the sliders detail and midtone range and in blending options with blend fulcrum and opacity. This is how the result looks like:

The advantage of using these blend mode is that the increase of the local contrast is accompanied by a matching increase of the contrast itself - in that multiply reverse blend mode darkens the highlights to the extent that they are shifted in the direction of the midgray - which looks much more pleasant than the increase of the local contrast alone. This comes pretty close to what some call “clarity”.

If this makes the photo too dark, you can increase the blend fulcrum, which will overexpose the highlights…

…but you can get them back quickly with the help of tone equalizer:

Difference before - after is quite clear:

16 Likes

Thanks for this tip.
Two questions:

  1. do you move the local contrast module before filmic in order to work with linear rgb unbounded data?
  2. any way to reduce the color cast on the snow in the final image?

No. This is not necessary. Everything that comes before the filmic serves for me rather as preparation (the basis) for the perceptive adjustment that comes afterwards. This way I make sure that I have enough space to shape the photo the way I want it to be. Local contrast is part of this perceptual adjustment for me that comes after filmic.

In this case however - although the processing takes place in the perceptual stage - I have “misused” the blend mode that belong to the linear part of the processing, simply because it gives nice results.

There are a lot of ways you can do this in the darktable.

Interestingly, in this particular example, there are no color shifts. The scene was indeed like this. The front part of the trees and the deck chairs are illuminated by the reflection of the sunlight from the orange house wall in front of them and the snow in shadow area is illuminated by the blue sky.
It is this play of colors that makes the scene so interesting to me!

But to answer your question, here I can use two instances of the color calibration module for this - one for blue snow in shadow (with appropriate parametric mask) and one for orange snow (of course also with appropriate mask):

You can also use various other modules for this - color balance, color zone, color look up table and so on.

The simplest version would be to mask the snow and desaturate it, since it has no color itself.

3 Likes

Very good explanation.
I would like to comment that maybe you need to readjust "filmic or “tone equalizer” after local_contrast. I usually check that I didn’t burn some areas when I apply it.

I always try to arrive to filmic with low contrast in the scene (some margin in black and whites) and a bit lighter in the middle tones, because with local_contrast and multiply_reverse blending mode I darken a little bit the picture.

Yes, I sometimes even correct the exposure afterwards. That’s the nice thing about pixelpipe, that you can still adjust the values in modules nicely afterwards.

1 Like

As Boris said there are many ways to deal with the cast…Two quick ways that I try is the hue autopicker for highlights in the colorbalance module. Often it nails it as it adds the opposing hue but you can adjust the saturation of the hue it selects to add to or more likely reduce the effect. Also in things like snow or skin color zones again with an auto picker…this time in the saturation tab and doing a shift drag to draw the range will auto desaturate based on your selection…both of these are quick and often don’t need any masking…

I am still somewhat of a newbie, and the blend mode seems to be discussed in terms of the local contrast module. But, in dt 3.4.1, the only blend modes I see are “local laplacian filter” and “bilateral grid”. How do I access these multiply blend modes?

You have to first use the hamburger to select RGB (scene referred).
I found that out today.

1 Like

Well, thank you, but I still get only the two modes I mentioned, above.

They aren’t blend modes.
You have to click on the normal mode (circle) button, to get blend modes.

1 Like

No, these are not blend modes. what you are referring to are two different algorithms that can be selected to increase local contrast. This has nothing to do with blend modes. Blend modes (for all modules) appear when you click on the white circle at the bottom of the module, and other symbols for masks.

Screenshot_2021-02-10 Clarity in darktable

and then on the right there is a list of modes. look at the screenshot where it says “multiply reverse”.

2 Likes

Got it. Thanks very much.

LC10

Can you further clarify when it might be better to use multiply mode vs multiply reverse and why?