This is a topic to continue a discussion that started out with ART and Sigmoid, intending to provide background not related to any specific software. I’m opening it at the suggestion of @micha.
I’m not an expert on any of this. Please, correct me when I’m wrong.
We’ll continuing from ART and Sigmoid - #62 by kofa, which I’m copying below.
You probably already know the term mid-grey, or midtones: stuff that we perceive as neither ‘dark’ nor ‘bright’: the sky, away from the Sun; grass; many wooden surfaces. When Ansel Adams developed his ‘zone system’, he centred it around mid-grey (German Wikipedia: Neutralgrau – Wikipedia ), which is defined as a surface that reflects 18% of the light. Here 100% would be defined as a surface that reflects all the light in a diffuse way, like white paper or a white wall; not like a mirror. However, in the world that we photograph, there are areas that are brighter than 100% diffuse reflections: light sources, or surfaces such as metal, water etc. that are almost like mirrors (called ‘specular’ reflections (German Wikipedia link: Reflexion (Physik) – Wikipedia)).
While our displays clearly emit light, so they are light sources, they cannot be as bright as the Sun, or the surface of the filament in a traditional light bulb. When printing, the situation is even worse, as paper is clearly a reflective surface, it cannot be brighter than 100%, by definition.
If we tried to represent light in a linear way, without compression, we may end up with something like this. Parts that are brighter than the display can handle are ‘burnt out’.
What we want is to be able to create a picture between 0% and 100% brightness that somehow resembles reality, even though in reality the contrast between the darkest and brightest parts of a scene is much larger than what paper or a display can produce.
If one were to simply scale the values equally (multiply pixel values by a number < 1), making sure that the brightest part of an image becomes 100% white on the display or the paper, the scene would be too dark. Here’s a screenshot using ART:
We could then add a curve on top to bring up the shadows. That is the traditional ‘base curve’/‘camera curve’/‘tone curve’ approach. A very bad attempt:
Luckily, our senses (sight as well as hearing) are (as far as I know, and probably only approximately) logarithmic in nature. That means, when the signal (light or volume) is multiplied by an amount (for example, doubles), we sense it increased by some amount (we perceive addition), not multiplication (for example, doubling). When the signal doubles again, we again perceive an increase by the same amount. So, it went from ‘10’ (whatever the unit is) to ‘20’, then from ‘20’ to ‘40’ (so it increased first by ‘10 units’, then by ‘20 units’), we feel it changed ‘x’ both times.
For sound volume, you are probably familiar with dB. That is also a logarithmic scale; the threshold of our hearing is defined as the base line 0 dB; a quiet room is 30 dB, a normal conversation is about 60 dB, a hairdrier 90 dB, a rock concert 120 or above. Even though physically the power levels moving the air are not 1:4 in ratio, we feel that if we take the difference between the threshold of human hearing to a quiet room, we then go again ‘as much’ from the quiet room to 60 dB (about the loudness of a normal conversation), then again to 90 dB (the sound level of a blender or hair drier), and once more to 120 dB, the rock concert.
Here is a plot of the ‘natural’ logarithm function:
At x = 10, the value is 2.3; at 20, about 3, so it increased by 0.7. At x = 40, the curve reads about 3.7; again, it increased by 0.7; at 80, it’s at 4.4, so it went up by 0.7 again.
With log tone mapping, you get this gentle curve that becomes less and less steep. There is more maths involved, but that is not so important.
Instead of darkening the image as shown above, we can apply the log tone mapping to keep the shadows visible, and map those bright parts (the sky, which is a light source) into the displayable/printable range:
However, you can also see that it also means you lose contrast. There is only a small portion where contrast is close to 1 (the black line is contrast = 1, the blue is the log):
.
One solution is to use a traditional S-curve, like the one I gave above, to place contrast wherever you need it. The other is a parametric curve, like Sigmoid. (filmic is another such curve, originating in the animation software Blender, I think, and also used in darktable in a modified form.)
If you open the curve explorer (also posted above), and only plot sigmoid (log-logistic), using contrast you can control how steep the straight part of the curve is. Contrast 1 vs 2:
With skew, you can control how much the shadows and the highlights are compressed. Notice when the line ‘leaves the ground’ and ‘hits the ceiling’. Skew: -2 vs 1:
(Edit: contrast is contrast (slope of a tangent, a straight line touching but not crossing the curve) at 0 EV; the slope at other points depends on the base contrast one sets, but also on the skew.)
How is that different from a traditional S-curve? The tricky part is that the y axis is in screen/paper brightness percent, but the x, the input, is in EV (so, at the bottom, you don’t see 1%, 2%, 4%, 8%, 16%, 32%, 64%, 128%, 256% and so on; 0 EV is mid-grey, the others are the given number of EV above or below it, so for each step the amount of light doubles or halves). That is where you can see the logarithm at play: a difference of 1 EV is doubling the amount of light, which we perceive as ‘it got brighter by the same amount each time’.
I do not know if this helped or confused you even more. Please let me know.
Michael asked me to provide more info on the logarithmic nature of our senses.
When sound volume (the acoustic power coming from the speakers - SPL: ‘sound pressure level’) doubles, we don’t feel ‘hey, it’s twice as loud’; we feel, ‘it got a bit louder’ (I have read somewhere that when people are asked to turn the volume up or down ‘by a notch’, they instinctively double or halve the power). In an article if found online (Decibel Levels and Perceived Volume Change – Conrad Askland), one can read:
- a 3dB increase in the signal means twice the power (electric power turned into sound)
- a 6 dB increase is 4 times the power
- a 10 dB increase is 10 times the power.
Yet, what we hear is (quoting the article):
- 6dB SPL increase is perceived as an approx. 50% increase in volume by a sample group.
- 10dB SPL increase is perceived as an approx. 100% increase in volume by a sample group.
(9 dB would be doubling again compared to the 6 dB, so 8 times the original power, and 12 dB would be 16 times the original.)
So, the music got 10 times louder, and we feel it got twice as loud.
(Answering a question about what I mentioned in the original thread about the threshold of human hearing being considered 0 dB, and a quiet room being 30 dB):
A ‘quiet room’ is not silent. Even with the windows closed, there is always a bit of sound (the wind outside, your own breathing, maybe a fridge running in the kitchen, a clock ticking). That is why places studying human hearing have specially insulated chambers. It is like ‘night’ (with starlight and perhaps a bit of light pollution from a nearby town) vs being in a completely darkened room / in the cellar / in a cave without any lights on.
(BTW, 30 dB means 1000 times louder(!), in terms of physical power, SPL.)
If you go into a dark room, and turn on a single light bulb, you’ll see ‘oh, it got a lot brighter’. But when you turn on a second, identical light bulb, obviously doubling the power, you will not feel ‘it is twice as bright now’. Adding a third bulb will be noticeable, but you don’t feel you added just as much light by turning on the 3rd bulb as when you turned on the 2nd and especially the first. It’s not about the absolute amounts, it’s about the ratios: turning on the first bulb increased the amount of light from almost nothing to whatever a single bulb produces, maybe a hundred times as bright. The second bulb ‘only’ doubled the light; the 3rd bulb only increased it by an additional 50%. Adding a 4th bulb would not feel 4 times as bright as the light of the 1st bulb, and would not feel twice as bright as the first and second bulb.
This phenomenon is not restricted to vision and sight. See:
- Weber–Fechner law - Wikipedia (English)
- Weber-Fechner-Gesetz – Wikipedia (German)