That would be a first log-like curve like this:
Followed by a contrast S-curve (sort of) like that:
But you see the drawback of not handling the saturation properly: blacks get a weird red saturation while highlights get completely washed away. Notice that I didn’t take time to tweak the curves to match filmic’s result, because creating a good log-like curve with spline interpolation is prone to cusps and really tricky.
Maybe I should drink water instead of
That’s by design.
You will end up with out-of-gamut colors in highlights if you do so.
The non-linear part of the curve does not preserve RGB ratios, that is everything out of the latitude bounds. So it makes sense handle saturation depending on the luminance adjustements (that’s what every tonemapping algo does without telling you).
First of all, 15 years of digital photography have made people used to oversaturated and overcontrasted pictures. So that’s something to keep in mind when you compare “film-like” digital processing and “post-digital-era” processing. It’s designed to be softer.
Then, if you want to protect the highlights from desaturation, you might have to make them less highlights, that is use an exposure module, decrease the exposure, and selectively mask the highlights. Or use the neutral density filter module. Or wait for this: A tone equalizer in darktable ?
The thing is, a global transfer function like filmic will always have some caveats. The behavior shown in the samples above is what’s expected from a film emulation: compress highlights, raise mid-tones, desaturates bounds. It might not suit every need, but it’s not a one-size-fits-all anyway.
Alternatively, give more space to your white point (increase the white exposure), so your sky is not interpreted as pure white, and less desaturated:
But this falls back to basic Adam’s zone system, and deciding in which “zone” you put your sky. At the end, you need to think “how would I have done that with film ?” and translate that into filmic.