How to correct incorrect exposure of sigmoid

You can start here: New Sigmoid Scene to Display mapping
And then there’s Evaluate the new sigmoid tone mapper just merged into master ... and Sigmoid module advice and guidance needed, for example.

Both with sigmoid and filmic, the idea is that a correctly exposed image has midtones where they should be. That is your task. Then, the tone mapper is responsible for getting the other tones inside the low dynamic range of the output / display world. With filmic, you have more (direct) control (set your black and white points). With sigmoid, you have indirect control (e.g. selectively boost highlights before or after sigmoid).

2 Likes

Consider a change of your histogram for starters to the waveform or maybe linear…that log histogram can look like it’s showing clipping when it really isn’t… It’s not a great tool to analyse your image whereas the waveform will give you positional information about what is bright or dark. Given your image in this case I wouldn’t use sigmoid or filmic…It really doesn’t need tonal compression…just my opinion maybe. In fact the basecurve now that it has a better position in the pipeline might do a very nice job here but for what it is worth there is a very long thread on the sigmoid module with lots of discussion. The shape of the curve will dictate a bit what you see. The skew moved left will crush blacks a bit more and make the transition to the highlights smoother…going the other way will sharpen the tradition to highlights and relax the shadows a bit… The contrast makes the central part of the curve steeper or shallower so depending on the skew the curve shape from the two setting will impact how the image responds to added exposure as the curve fades to 1.0.

1 Like

There’s also Logistic function - Wikipedia

But you can still use it, you can copy it from an XMP which has it, or put it in a style, or there are no doubt other ways to get at it. I know it was deprecated for a reason, but I don’t think it harms to use it provided you make only modest tweaks.

Following up on my comments on how it moves I made this little visual…using a color checker so there are only 6 points but it makes it pretty clear… In the first run I set my histogram profile to srgb so the third patch is roughly 50% as the test image is well exposed… See how contrast and skew moves the rest of the values on either side of it while it doesn’t move its anchored… Then I change to a linear profile ie the default linear rec2020…now the patch is around 18-20 % and see again how the contrast and skew moves the rest of the values… Now look what happens when you change exposure…everything moves along the curve and you get a version of what you shared at the start of the thread…so knowing how things move, setting the anchor right and using the display black and white if needed should get you there most of the time without too much messing around…

3 Likes

It’s interesting how the skew mostly affects the highlights whether it’s a positive or negative skew. I think Nicolas Winspeare mentioned this on his YT channel as well. It’s not what I was expecting when I first started playing with Sigmoid, and this video makes it very clear, at least at the histogram level.

Even you’re not interested in filmic you need to understand how it works since there’s much more documentation and explanation on the basics of this kind of tonemappers.
Sigmoid is quite similar, but with a more streamlined ui (but removing control comes with a price :wink: ).
Since sigmoid was released when filmic and the scene referred approach was quite adapted by many users, there’s not that much basic documentation on it :wink:

1 Like

Or use rgb levels.

I would say this one is not deprecated.

As much as I like sigmoid, I think that there is a degree of freedom missing from its mapping. This is most apparent in the slope graph (see this nice interactive tool @jandren provided). For me, there are 4 relevant degrees of freedom of the luminance mapping:

  • where the highest slope (contrast) is, this is implicitly taken care of by the exposure module,
  • what that slope is (contrast in sigmoid),
  • how the slope falls off left and right compared to that (skew in sigmoid controls both, one df missing).

As @priort says, the waveform is a much better tool here.

Default Sigmoid processing:


The shadows are indeed not quite black, although the blue channel does clip elsewhere and the red gets close.

I’m not sure what that has to do with the subject at hand.

What’s the problem with RGB Levels? It does the same thing, only more robustly.

3 Likes

And in this often referred to write up from AP… ie the Lab vs RGB…

3 Likes

If I’m reading this correctly, AP was saying that there’s no real difference between RGB levels and Color Balance RGB, but he’s advising against using another module for the task.

For me, the convenience and ergonomics of the levels tool is enough of an advantage to use it

1 Like

Its a workflow thing and people will migrate towards what works. I used to use levels sometimes after filmic to fine tune it but I found that I went back to the image or copied the stack as a style and forgot about it I would get strange results because it had imparted those limits on the data.

For these sorts of tweaks now I usually use global brilliance for “white” and global offset in the 4 ways for “black” and then some perceptual brilliance grading…

I think AP’s comments were about the old colorbalance module and I think they will still hold for the new one as he assigned them however when you read about the other background math and colorspace updates that are used to support the scene-referred pipeline and modules esp wrt color hue and saturation that is part of the new rgb CB module for me it just makes sense to do the editing there so it can be part of the math for the output of the module…

1 Like

Yes, that sounds sensible and helps me.

I think the solution for me is to accept that the histogram doesn’t have to be completely filled, like I learned 20 years ago.

In this photo, which I find to be a bit too dark, it is sufficient to increase the exposure slightly, but not to the point where the histogram hits the right.

I have also tried it successfully in other photos. That’s the solution for me for now.

It’s in the wrong place in the pixel pipe (scene-referred part) and I have to move it every time.

But it does what it’s supposed to do.

Yes, I understand filmic. And I’m not saying that I fundamentally don’t care.

But with filmic the problem simply doesn’t occur and I can use white rel exp to bring the histogram to the right edge and even above it.

But that doesn’t change anything about sigmoid.

I guess the point is that sigmoid works the way it does and there’s a reason why.

I’ve now accepted that and it’s not a bad thing if sigmoid protects the lights.

If I don’t want that, I can replace it with filmic.

1 Like

Yes, but clipping isn’t the problem I had.
It was rather the opposite, there was a gap in the lights and this can also be seen in the waveform histogram.

But yes, waveform has some advantages.

Ya and that was because I think you were using exposure to try and move the whole histogram when you should stop once you had your middle gray set as you needed…when I tried it as demonstrated in my first reply just changing contrast and skew altered the curve enough to more fully expand the histogram if that was the goal…there was no need for levels in this case…maybe in others there could be…

Sometimes focusing too much on the histogram can lead to breaking your photo…

3 Likes

It’s very interesting, the same flatness / not hitting white was already the subject of this old ‘filmic’ (not darktable’s implementation, but related) blog entry – just look for ‘overshoot’ under Deriving the Shoulder.
I think it also demonstrates what Aurelien got wrong with those weird brightness inversions on saturated areas. That’s under Luminance Only. (But it may be best to split this off to Processing, maybe, since this second part is not relevant to the original question.) So, if someone wants to continue the general tone mapping discussion, maybe we can do that here: Tone mapping and gamut compression articles

1 Like

Yes, and I’ve found that my edits take 3 times longer than they should because I’m always experimenting with different ways to do the same thing but better… :grimacing:

1 Like