rebooting color balance

One curiosity I have about the new module is the color correction is four ways (offset / lift / power / gain), while the old module was three ways (slope / offset / power or lift / gamma / gain).
Three parameters are associated to shadows / midtones / highlights, so what about the fourth ?

Thanks for the clarification. So that’s why lowpass module is before color balance. In its output it says “special, lab, scene-referred”. Does that mean, to stay in scene-reffered workspace, that you should then use blend modes from the “RGB (scene)” blend color space?

Given this statement from the manual I think that would make sense

Note: When using blend modes on any module, you should be aware that many of the blend modes are optimized for display-referred space and assume a mid-gray value of 50%. For the linear scene-referred space, stick with blend modes based on arithmetic operations (addition, multiplication, division, subtraction, average), on maximum/minimum comparisons (screen) or on channel separations (hue, color, chroma, etc.).

3 Likes

However, there are some blend modes available to both ‘RGB (display)’ and ‘RGB (scene)’: Addition, Subtract, Multiply, Difference, Average, Lightness, Chroma
Is there any difference between the blend modes familiar to both?

When in scene-referred part of pipeline (pre-filmic) we obviously stick to ‘RGB (scene)’ blend modes. But how about after filmic? Eg. modules like Local Contrast, should we use ‘RGB (display)’ for those? And what if we move a scene module such as Exposure after Filmic to perform a Multiply blend. Does it matter whether that blend is done in ‘RGB (display)’ or ‘RGB (scene)’?

This also leads to parametric mask questions. Pre-Filmic, I guess middle grey of ‘g’ slider is 18. But after Filmic, is middle grey of ‘g’ slider now 50?

Well try this one
take the rgb tone curve
don’t do anything 
blend it on an image in display referred subtract and scene referred subtract
maybe try around 10%
the effect in display is way stronger
so even subtract does not equal subtract. I think the math is a bit different in the way it is applied. Someone familiar with the code or the nuance of this could comment its just an obervation


1 Like

Now i am confused. So i shouldn’t put any module between filmic and output profile? I did this with modules i used to do some dodging and burning or with the local contrast module.

I did a test. First applied exposure and filmic. Then applied 2nd instance of exposure, blend mode ‘multiply’, first in ‘RGB (scene)’ then in ‘RGB (display)’. Result was identical. Then moved 2nd instance of exposure after filmic. Again both ‘RGB (scene)’ and ‘RGB (display)’ matched. So for that blend mode, the math appears to be the same. The effect is of course different applying it before and after filmic.

Using parametric mask, I then slid shadow sliders up to 18 (mid grey).
‘g’ in ‘RGB (scene)’ gives very similar results to
‘g’ in ‘RGB (display)’, and
‘L’ in ‘RGB (display)’, but gives completely different results to
‘Jz’ in ‘RGB (scene)’. In order for that to give similar results, the slider had to be moved up to 0.59

Testing all common blend modes on different modules, only ‘multiply’ and ‘average’ give identical results in ‘RGB (scene)’ and ‘RGB (display)’, although ‘addition’ was quite similar. Subtract, difference, lightness and chroma all gave different results. So for those 4 or 5, after filmic, I do not know whether it is “more correct” to use them in ‘RGB (display)’ or ‘RGB (scene)’.

I’m just going to use the default of the module and use my eyes. If you end up using mostly newer modules I think you will be offered the scene-referred blend modes for the most part. Perhaps not very scientific but with all the possible combinations introduced by moving modules around I am not going to try to keep track of it


2 Likes

No. Slope, offset and power, as well as lift, gamma and gain all had effect on the whole luminance range. Each of them only had a bit more weight, by algorithmic side-effects, on some sub-range. For example, slope/offset/power does:

\text{RGB}_{out} = ((\text{RGB}_{in} + \text{offset}) × \text{slope})^{\text{power}}

You see in the above formula that nothing actively separates luminances. The current formula does almost the same:

\text{RGB}_{out} = ((\text{RGB}_{in} + \text{global offset}) × \text{slope}(\text{luminance}))^{\text{power}}

Notice the difference is now that \text{slope} is a function of the variable luminance (Y), decomposed in 2 terms:

\text{slope}(Y) = (1 - \beta(Y)) \left((1 - \alpha(Y)) + \text{lift} × \alpha(Y)\right) + \text{gain} × \beta(Y)

where \alpha(Y) and \beta(Y) are the opacities of the shadows and highlights masks (it’s a simple alpha overlay of 2 layers, really).

TL;DR: the new 4 ways is only the old slope/offset/power where slope is split into lift and gain, and both are applied on different layers later overlayed with usual Porter-Duff “over” compositing operator.

But the offset and the power still have effect on the whole range, again with more weight on some subrange.

Multiply is a multiplication no matter in which space you do it
 The algebraic operation doesn’t change. What may change is the occurrence of clipping at 100% or not, and also if you multiply in Lab (which has a cubic root on), you obviously don’t get the same result as if you multiply in linear.

Please state your space. After and before filmic, middle-grey is at 18% linear. Filmic preserves middle-grey unchanged through its transform, it only shrinks or dilates the dynamic range around that pivot. 18% linear = 50% perceptual (in Lab, Lch, JzAzB etc.).

Think about the space you are in. Before filmic, you are in scene-referred space. After filmic, you are in display-referred space. Doing things in display-referred is unsafe and not output-agnostic, so you want to avoid it
 but if you still want to use the display-referred modules in dt, you should put them in the display-referred part of the pipeline
 waiting for these modules to get translated to scene-referred.

1 Like

Since middle grey is 18%, a.k.a. -2.45EV from 100% reflectance, is it correct that in order to use the multiply blend mode without affecting midtones (middle grey), one has to use a blend fulcrum of 2.45 EV, since multiplying something in linear space by 0.18 is the same as reducing exposure by 2.45 EV?

2 Likes

That is exactly what I was wondering.

Assuming 100% opacity, of course.

Yup.

1 Like

Is the official documentation of this module already in preparation? Where can it be found?

It seems that it is not ready yet: darktable 3.6 user manual - color balance rgb

Eventually it’ll be here: darktable 3.6 user manual - color balance rgb

How is your French?? Aurelien did a video on it
en francais

I forget if it is about this version. Could you post the link for our convenience?

Uses the mask tab as well
sadly I could not get good English subtitles
 https://www.youtube.com/watch?v=qRLH5hMschs

I have also seen that that chapter of the dev version of the manual is empty, I thought I saw some draft some weeks ago - maybe it was deleted?
I know about AurĂ©liens video - stated to watch it some time ago, but didn’t finish yet.
Thanks for the quick answers though.