Proposal for a linear + highlight roll-off tonemapping

I think the two photos above come from playraw posts…I am sure I have seen both before…

Nothing wrong, moving the white relative exposure slider will change the values under middle gray.

Could you define in-gamut point?

There are negative rgb values that are really out of gamut colors, filmic push colors to be OOG with the midtone saturation slider.

There are rgb values > 1 , these are in-gamut but just too bright to be displayed.

We could decide how much saturation vs luminance preserve keeping the hue constant

This is a good paper about recover information above 1 after tone mapping

This could be easily extended to implement chroma clipping , basically detect the rgb pixels where at least one value is negative and desaturate it until it becomes 0.

original + saturation

chroma clipping

chroma clipping + lch hue blend

original.pfi (15.0 KB)

This is the g’mic code for the chroma clipping, it’s really fast
-fill i=i;lum=(i0+i1+i2)/3;min=min(i0,i1,i2);f=(0.00001-lum)/(min-lum);f=if(f<0,0,f);f=if(f>1,1,f);i=if(min<0,(i-lum)*f+lum,i);

For the values above 1.0 (not really OOG) the film_like clip is another good option because it reduces and preserve some saturation



DSCF9668.pfi (21.3 KB)

yes, 50 code value in lab color space is middle gray, values below middle gray are increased when the white relative exposure slidere is moved to the right

Right, I now understand what you say.

Moving the white relative exposure moves the right bound of the dynamic range which encompasses the wole luminance range. Who said “white” was anything like an highlights compression ? White, black, those are 2 bounds. You set them. Between them is the dynamic range. We handle it as a whole, because it is.

Don’t use that shit, it’s easy. You have better ways to increase saturation sooner in the pipe.

Whatever coordinate inside the gamut boundaries that minimizes the distance with the original color.

Using which color model ?

This is not hue-linear.

1 Like

The trouble is that that ‘shit’ is the default. When someone starts using a software as complex as darktable, a useful piece of advice is ‘go with the defaults, only tweak stuff you understand’. So, users will either leave that slider alone, or, even worse, will think they can yank it around. Shipping an application with a default setting that the principal developer of a module considers ‘shit’ is quite weird.

And a question: is it possible to set mid-tone saturation boost to 0, and save a preset, without that also saving the current black & white levels, which are, if I understand correctly, normally automatically set based on exposure (e.g. exposure compensation set in the camera) when the module is initialised?


Very counter-intuitive, in fact

You have to thank the worshippers of the OOC JPEG look for that. That default is to make them shut up. If I set the default to 0, I will get all the “filmic desaturates images” all over again. If I put a notice about needing to tweak saturation manually somewhere else in the soft, I will get other messages in tune with “why do I need to manually adjust saturation” ? (Answer : changing luminance at same chromaticity might not produce the result you expect).

There is no solution except sending some range of the user base to hell and stopping to listen.

Wanna go the manual way ? Set midtones saturation to 0 and carry on editing.
Wanna OOC JPEG-ish look ? Defaults should cover it fairly.
Wanna both ? Go annoy someone else. I’m tired of that shit.

Apparently, OOC JPEG is the Truth®, so what do I know…

That’s because you are the ones sitting on your arse, commenting and having opinions, and not the one taking shit from the internet after 8h of coding.


Oh you will love this one then… Scene referred, display referred, and the Colour Science of Canon/Fujitsu/Nikon/etc. in Darktable (filmic-rgb module in particular) - #6 by OK1

You thought “intuitive” was bad now you can have “photo intelligence”


I understand your irritation. How about Set filmicrgb default mid-tones saturation level in preferences · Issue #9183 · darktable-org/darktable · GitHub ?


Why do you need a preference when you can create a simple automated filmic preset that applies to all your images ?
With a bunch of custom presets, you can get a nice default look tweaked to your own style and taste.

Please could we have a list of such defaults so that the non-ooc-worshippers can set up alternative presets, and I’ll update the manual.



That is, if you create a preset, then the filmic initialisation step, which would normally set the black and white levels based on the in-camera exposure compensation, is skipped. This is also described in the alternatives section of the feature request.


The other down-side to presets is that they can freeze other module parameters in place, that might be improved/enhanced in future releases. For example, if I created a filmic preset now in v3.4.1 that preset would hard-code the color science to v4 (2020). If I then use the same preset after v3.6 is released, it wouldn’t get automatically updated to v5 (2021).

The ability to override individual parameters in presets but leave the others unchanged would be very useful (though I don’t know an easy way to go about such a thing).

Right now the alternative, if you compile your own darktable, is to manually change the defaults before you compile it :slight_smile:


Indeed those are limitations of presets, it’s an exercise to have those updated with each release, but at least they can be used to do quick developments.
As you say, the best between current presets and defaults, would be to be able to change default values based on some EXIF infos like current presets.
Doing this would probably require a lot of changes in module default logic and in the ui.
But that could be worth the effort, instead of adding specific preferences for all modules.

Yes, for each module, in the presets menu, I would love to see the options ‘system defaults’, ‘user defaults’ and ‘save current as user defaults’

System defaults would be as shipped by Devs, user defaults would be as saved by users. The only way to really do this now is to save preset for every module, then save that as a style. If you happen to change your presets, you must overwrite the style all over again. Not the end of the world, but would be simpler to save user defaults that are there automatically, and not need to apply a style. As ever, I do not know the complexity or viability of coding such a task. But if others think thi sis a good idea I can always open it as an issue in Github. You never know…

System defaults: just reset the module.

Still, the problem with presets is that they affect all settings of a module. So, if I load an image, and filmic RGB calculates (based on exposure compensation) default white and black points of say 5.5 EV and -7 EV (just random numbers), then I set mid-tones saturation to 0% and save this as a preset, the white and black points will be saved as well.
When I load an image where the calculated white and black points are 5 EV and -8 EV (again, random), but I apply my preset, the calculated values will be overwritten with those saved in the preset.

The way to do as you have requested is to create a preset and make it auto-apply to all images - no need to use a style. If you want to reset back to that default you can Ctrl+click on the reset button (which reapplies any auto preset). Though that still has the disadvantages that have already been mentioned (that it saves all parameters and switches off any automatic default processing).

This has the additional disadvantage that double-clicking on a slider resets it to the system default and not to a user-defined one.

1 Like

Yes, all my filmic presets just have the default white and black points.

That’s interesting, thanks.

In ART and RT there are some module that have a check box under them called auto. This will use an automatically determined value. If this could be carried through in a preset and or style to be recognized and then run the “auto” function if checked and not if not. Being unchecked would act as it does now in DT and transfer values…not sure though as the pipeline changes would there be cases where you would not want to re-run the auto setting ??? Not sure…

1 Like