ELI5: Black and white levels in Filmic

Very useful discussion. So, we are not supposed to fiddle around in filmic? What about the reconstruction tab?

White slider to the left = brighter highlights, to the right = dimmer highlights.

Black slider to the left =lighter shadows, to the right = darker shadows.

Set the midtones using exposure.

You don’t need much more than that

2 Likes

Well … if you messed-up in creating the image initially then you might need to work with the reconstruction tab. There are lots of bells-and-whistles in the module for special circumstances. Getting the basics correct should be task number one.

All you need is practice and experimentation: we have plenty of PlayRaws for that. :wink:

Not always … there’s the rub

I think filmic is quite easy, once one understands a few key points.

It is a tone curve. Its input is the linear (twice the number → twice the physical amount of light) view of the image; its output is closer to the world of the display. The linear side is ‘HDR’ in the sense that the camera typically handles more dynamic range than the display (it needs not be a HDR composite image). Its current output is low dynamic range, but with new display technologies, that may change. The important difference is the encoding: in the output, twice the number does not mean twice the physical amount of light.

scene tab: the curve is centred around the orange dot, representing mid-grey. Even though visually it moves around when you alter the black and white relative exposures, it still represents the point around which filmic is built, and it always maps mid-grey to mid-grey (the real behaviour, keeping mid-grey at a fixed position, and re-drawing the whole graph around it, would have been rather inconvenient). The X-axis is logarithmic (values are in EV, a change of 1 unit means doubling or halving the amount of light). The white and black offsets simply describe what input values will be mapped to black and white output, respectively. Even if one of the previous modules seemingly pushed highlights to clipping, those can be recovered, given that the raw sensor input was not clipped. Negative shadow values cannot be recovered; in exposure, one may use the black level to make sure no value is pushed below zero.

look tab: contrast defines the steepness (contrast) around mid-grey. Latitude defines the range in which this contrast is maintained. The same latitude is used for retention of colour saturation: outside the range, contrast and saturation both drop: shadows and highlights will be desaturated so black and white will be neutral; contrast will drop as shown by the shoulder and toe of the curve. Shadow/highlight balance allows you to slide the range higher or lower. If the graph misbehaves (becomes non-monotonic, which means contrast is inverted; such parts are shown in orange), you can:

  • reduce contrast
  • reduce latitude
  • slide the range.
    The first two always work (if you reduce them enough), the third one may or may not work, depending on how much the curve is messed up.
    This should be enough to get started.

Create a black-to-white ramp in the Gimp (save as a PNG or JPG), load it into darktable, move exposure, turn on filmic, place a few colour samplers on the image, and adjust settings. This will help understand filmic. See Darktable - Workflow approaches - Custom Base curves, LUTS, Filmic - #20 by kofa

6 Likes

Here’s a grey ramp to play with.

3 Likes

When? Please explain.

without a doubt filmic works, for me with my imagery, most of the time and the sliders are totally predictable but there are occasions when either one or both of the sliders appear to give totally negative responses.
This why I say that we must not look upon filmic as a simple drop-in for a tone curve our sliders are doing far more than ‘add-shadow’, ‘add-highlights’.
Now you are going to ask for a specific example … and I will try to dig one out later so as to satisfy your question.
More importantly is the why. … I think it all falls back on the type of image and how I have initially set the exposure. I think that there are times when the ‘clever’ algorithm simply scratches its head and wonders just how to deal with such an oddity.
If you have not come across this situation it may be that your material is more uniform than mine. I have been running filmic over images taken over the past 10 years with a variety of cameras and often in unusual situations in an effort to find just how this latest dt direction changes the look of my material.
I am by the way running the daily git version on Manjaro/Arch.

I’m interested in your results… Unless you’re getting negative RGB values, which completely mucks up things, then filmic should behave predictably.

As with any algorithm big or small, filmic comes with a set of assumptions about an (input) image. If they aren’t fulfilled, then obviously it won’t be able to handle it. There are going to be images that won’t like flimic or require preparation. I have come across many Play Raws like that.

There is another factor that we are missing in our discussion. Even if the basic filmic works as advertised, there is still the aesthetic component. The user might not like the outcome. To be sure, dt’s module provides controls that could assist with that; but sometimes, it becomes all about that so much so that people make a mountain out of a molehill. I think that is why there is so much discussion about it.

1 Like

@kofa If I am getting the discussion off course, ignore this. You brought up black level correction in exposure. Since it affects filmic, may I ask: the manual says, “Adjust the black level point to unclip negative RGB values.” Do I look at the histogram and change black level to move the left side of the histogram graph off the left edge of the histogram box? Is that what that means?

1 Like

Yes. It is my understanding that that is the reason why selecting the scene-referred workflow in preferences sets up a tiny negative black level correction (screenshot from fresh dev build):
image
How to check for that – honestly, I don’t know. I just look for ugly pure-black regions where I’d expect to have some detail.
The CAT tab in ‘colour calibration’ allows you to turn negative numbers into 0.

1 Like

I’ve never understood the tool-tip since I didn’t know in the first place what I would do to add more density in blacks. I don’t understand “poorly set;” is that too high, too low? What pushes RGB values into negatives? A black level correction of -.0002 does exactly what to black levels? It’s a mystery.

The main reason to set a black level is to get rid of the dark current bias from the sensor. That’s usually done internally by the raw processor, using a camera-supplied value from the metadata or a table in the software. It effectively removes pixels from providing tone if their value is too low to escape that bias.

After that, I think the remaining reasons are aesthetic. I occasionally use a black subtraction to push low values even lower in order to separate them from high values. With a background that is darker than the subject, It works kind of like a poor-man’s layer mask.

Setting a black level is a subtraction of the level value from all the channels. So, any R, G, or B value that is less than the black level becomes negative and unusable to render tone in the image. “-0.0002” would represent a proportion in the range 0.0 - 1.0, so for sixteen-bit integer values that range from 0-65535, 13 would be subtracted from each R, G, and B value (13 = 65536 * 0.0002)

Edit: occurs to me that the black level being discussed here is in terms of stops of dynamic range. A different use of the term… sorry to waste bandwidth.

If I’m reading the source correctly:
output = (input - black_level) * scale;
where scale = 1.0 / (white - black);
and white = exposure2white(exposure);
and exposure2white(exposure) = 2^(-exposure).

So, the black level maps the given value of input to 0: a negative black level shifts input values to the positive direction (e.g. an input of -0.0002 will become 0 before we apply exposure (multiplication)).

Suppose you set an exposure (correction) of 1.5 EV.
This means you want to push the pixels with the current value 2^(-1.5) to 1. That would mean white = 0.3536 (approximately, since 2^(-1.5) = 0.35355339059).

Also, suppose your black is the default -0.0002 (actually, in the code it’s set to -0.000244140625).

white - black defines the size of the black - white interval; on one end you have the value of the darkest pixel, on the other end the one you want to push to 100%. In our case, that’d be
-0.0002 … 0.03536, with a size of 0.3536 - (-0.0002) = 0.3538. This is the range you want to stretch out to cover 0 … 1. -0.0002 will be pulled to 0 by the black level correction.
To see by how much you stretch, you need the scale = 1 / size_of_range = 1 / 0.3538 = 2.8265 (approximately).
So, in the end, your mapping is:
output = (input - black_level) * scale = (input + 0.0002) * 2.8265.
So, if your input pixel is at 0%, it’ll be moved to about 0.0006.
10% will end up at 0.2832153
35.36% will be mapped to 1.0000157
50% will be over 100% (1.4138153), but you’ll be able to recover it later (tone EQ, filmic).

Now I see. A negative correction ADDS. So values that are just a little negative get used by becoming a little brighter. Conversely, if you used a positive correction, that would push near-black colors out of gamut. Too much and you would spoil your image. Right?

Yes. But I think even if you don’t read the source, just experiment a bit, you can deduce what the controls do (if you disable filmic, so the output remains linear, it’s even easier to see). You can even apply exposure to non-raw files, so grab the grey ramp I’ve posted a few times (or make one in Gimp), and play around.

I too own a Nikon D3300. I’ve found that if I set picture control to ‘neutral’ and ETTR, as best as possible without clipping green channel (in normal daylight circumstances) then I get about the standard 0.5 (actually a little less) stop of headroom before highlights clip, which exposure module in scene referred workflow automatically applies. This is using matrix metering, without exposure compensation. That makes the histogram very trust worthy, and I always check it after adjusting settings.

2 Likes

Thanks very much. I will look at trying this the next time I am shooting.