Let’s open this image in darktable:
Here, we have 9 EV of dynamic range, but no overexposed area. How to recover that ?
The first option would be to use the input profile correction module and tweak the gamma ( = 0.448) and linear (= 0.05), since we have a custion matrix. Then add a stiff S curve in RGB mode to restore the contrast and saturation:
Well, that recovered the mid-tones, for sure, but blown away some of the highlights and lost the texture of them (look how flat the right shoulder looks). With this module, you always have to sacrifice something, it’s really hard to control accurately what happens from the shadows to the highlights. So now, let’s try with the base curve module instead, to get more control:
It’s better, and we don’t need an additionnal S curve, but see how we still got the highlights burned a little bit ? Moreover, we had to fine tune every control point, which is annoying. Wanna use the highlights/shadows module to fix the highlights ?
Congrats, you just made the subject darker and flatten the shapes ! Using the tonemapping modules will mess you colors even more. So, is there a solution ?
Yes ! This : https://en.wikipedia.org/wiki/ASC_CDL, as showed there:
So, i rewrote the input color profile correction in darktable to use this method instead: https://github.com/aurelienpierre/darktable/tree/color-grading
Now, back to darktable, the first step is to make the image linear (and very dull):
Adjust the slope so than you don’t get blown highlights, then adjust the power (which is essentially the gamma) so that you center the histogram in log preview, and finally, tweak the offset to add a bit more depth in the shadows.
Then, add a stiff S curve in the tone curve module in auto RGB mode:
Final result with hue adjustment (to rewove the green cast from the leaves reflection), local contrast (defaut setting) and Kodak Ektar like profile:
It use to take me ages and never-ending modules stacks to achieve a worse result than that in this kind of setup, especially because the dress color is on the edge of the sRGB gamut. Notice how the highlights are smothly blended with the rest, in the bokeh, without rings or fringes.
Now, you have a reproductible workflow involving 2 modules : 3 sliders to set and 4 control points to set an S curve. I find it easier and quicker to set, more forgiving than the former gamma version (although you could fine-tune it for yours to get close results). It’s beautiful, natural looking, and you don’t get weird color artefacts in highlights (compared to the basecurve method). It seems compliant with video industry standards, as far as I understand.
Additional benefit : modules such as local contrast and equalizer are now safer to use (regarding highlights clipping and over-cooked results) since they are applied on “linearized” (not sure if this term is mathematically accurate here) data.
Last one : the new algorithm is a simple linear transfomation, very straight-forward and a bit more computationnaly-efficient than the legacy matrix-based gamma correction.