Non-monotonic curve in filmic, resulting image terrible
Tested with the RAW file available here:
From the original image (empty history stack, not even the default modules), activating filmic and clicking "auto tune levels" results in a non-monotonic curve, and then obviously a really bad resulting image.
The image is clearly underexposed so I was more or less expecting suboptimal results, but my understanding is that at least the curve applied should be monotonic, so this looks like a bug.
If I correct the exposure before the "auto levels", I also get a disappointing results, but this is probably expected since the image is low-key hence the average is very dark. A picker stoke on the face and I get satisfactory results.
#2 Updated by Aurélien PIERRE 4 months ago
- File Capture d’écran du 2018-12-04 16-10-40.png added
Everything is normal here. To get proper results, the dynamic range should be more or less centered in 0 and > 6 EV.
As stated in the doc :
- fix the exposure (here : +3.33 EV)
- fix the white balance
- if you plan on using the auto-tuner, use an high-quality demosaicing with color-smoothing
- do the auto-setting on the face. Since the face is the brightest spot, and yet not expected to be white, allow a safety-factor of 20 % (the skin average luminance should be around 77%). Since it's studio work, the auto-setting won't work, so you need to force the grey around 18 % (it's no HDR).
#3 Updated by Matthieu Moy 4 months ago
Again, I was not expecting miracle, but your article (https://eng.aurelienpierre.com/2018/11/30/filmic-darktable-and-the-quest-of-the-hdr-tone-mapping/) says that the curve should be monotonic, and here it's not at all. So, I don't understand what's supposed to be monotonic...
#5 Updated by Pascal Obry 4 months ago
Just an idea. I had this kind of result and found a pattern. When the image is low-key or high-key the auto-tunner does not work. One really need to use the manual controls. Now I'm wondering if an analysis of the whole image to check if low-key or high-key could help the auto-tunner to find a proper solution to the final equation? What do you think Aurélien? Maybe something to consider at some point.
In my experience filmic works great with landscape with an histogram properly distributed.
#6 Updated by Aurélien PIERRE 4 months ago
Actually, the auto-tuner is designed specifically for landscapes, e.g. cases where you have an even distribution of luminances over the picture (where median ~= average). Let us recall that the auto-tuner uses the average over the area as an estimation of the grey, the minimum as an estimation of the black and the maximum as an estimation of the white.
That means, of course, non-even luminance distributions will never work because the average luminance is off-centered, and these cases need to be handled manually. Hence the separated color-checkers.
Now, about introducing some low-key/high-key detection: it would be possible to compute the median instead of the average and solve an equation to remap it to the center of the histogram (assuming a gaussian distribution), but that would sort of neutralize the intent. Although I think the proper way to do it would be segmenting the picture and taking the average of the most significant segment (but the definition of "significant" remains to formulate : the widest ? the brightest ? some weighted combination of both ? etc.) and that begins overkill already.
But I think the problem is rather at the user level: low/high-keys are artistic choices that artists will want to tweak themselves manually, and are easy to copy/paste from one picture to another provided a controlled lighting setup has been used. So I see little interest to have it automatized. For this purpose, I feel the grey color-picker applied on the region of interest would be the best quality/cost ratio and prevent the already cluttered UI from becoming a true aircraft cockpit.
I think the "normal" behaviour of this iop is sometimes hard to understand for an average user. Another example to demonstrate it is this photo: https://discuss.pixls.us/t/play-raw-processing-a-very-high-contrast-raw/6534. Just try to get an acceptable result from it using filmic to see what I am saying.
#8 Updated by Aurélien PIERRE 4 months ago
I don't know what an average user is. There are all kinds of people who use darktable, from professionals to beginners, so at some point, we build tools that solve our problems and users follow and learn, or they don't. The good news is now you have a full doc: https://eng.aurelienpierre.com/2018/11/30/filmic-darktable-and-the-quest-of-the-hdr-tone-mapping/
#10 Updated by Matthieu Moy 4 months ago
Note that with https://github.com/darktable-org/darktable/pull/1874, I'm not getting the non-monotonic behavior anymore on this image. I do get an "ugly" image, but it corresponds to what I expected from an automatic tool: the module tried to "properly" expose the background, i.e. make it dark grey so the low-key aspect of the image is lost, but there's no contrast inversion nor over/under-exposed parts. IOW, it's wrong artistically speaking but technically "well exposed".