Le 26/06/2014 12:06, Robert William Hutton a écrit :
> Hi Stéphane,
>
> As far as I know the reason for the base curve is there to convert between 
> the different way our eyes and digital
> sensors see light, the digital sensor being linear and the eye (kind of) 
> logarithmic.  That is, you have to convert from
> what the camera sees, being uniform in terms of the number of photons falling 
> on a particular pixel, to what the eye
> would see, i.e. a "perceptually uniform" space.  An example of this is that 
> the human eye sees 18% grey as "middle
> grey", i.e. half-way between white and black, whereas the sensor sees 50% 
> grey as half-way between white and black.
> This is also the reason for "expose to the right" as there is far more 
> information in the highlights than the darks.
>
> http://en.wikipedia.org/wiki/Lightness_(color)

Thank you for your interesting comment and references on perceptually 
uniform color space, which to me was a benefit of using Lab, without any 
reference to a base curve (and indeed that Wikipedia page says "The 
remainder of this section is a chronology of lightness approximations, 
leading to CIELAB." which conversion includes that lightness curve, 
making the concept of base curve appear extraneous in that context).

I just looked closer at darktable source code and 
tools/iop_dependencies.py . Here's an analysis below, it might help in 
figuring out the truth.

## Base curve: related to perceptually uniform colorspace ?

Actually, the part of the processing that is in Lab in darktable is 
between the "colorin" and "colorout" modules.
When handling a RAW file, "colorin" module converts RGB linear raw data 
(generated at demosaicing step and possibly tweaked in the meantime) 
into Lab. Then many modules work. Then "colorout" module converts into 
output colorspace (usually sRGB). The more modules may work.

Everything between "demosaicing" and "colorin" (including profiled noise 
reduction, exposure, lens, basecurve, bilateral noise filter) receives 
and outputs data in linear RGB colorspace. Regarding base curve, it's 
confirmed by reading source code and even tool tip in gui.


If the base curve were here to turn the picture data in a "perceptually 
uniform" space, wouldn'it be part of the RGB->Lab transform instead ?

If the base curve were here to turn the picture data in a "perceptually 
uniform" space, how comes there are different base curves to mimick 
camera manufacturer settings ? This suggests base curve is more a sign 
of "artistic" (or at least non-scientific / non standardized / 
proprietary) tweak, right ?


> http://www.luminous-landscape.com/tutorials/expose-right.shtml

The argument on that page about "expose to the right" seems to assume a 
histogram with X scale graduated in exposure steps (i.e. non-linear) 
from -5 EV to 0EV.
In that case if you underexpose by one EV you shift (translate) your 
histogram one fifth to the left and use only half of the actual 
available values (therefore increasing noise by a factor 2).

In other words, this web pages seems to warn: "if you look at A 
histogram with log X scale of 5 EV breadth, be aware that the picture 
may be severely underexposed while the histogram looks just slightly 
shifted by e.g. one fifth".

## What's the X scale of darktable RGB histogram ? Answer : linear from 
0 to max.

I though most RGB histograms simply had a linear X scale from 0 to max 
value. In that case if you underexpose by one EV, you squeeze (not 
shift/translate) the histogram into its the leftmost *half*.

A simple test with an image of a grey 0-255 ramp shows that darktable 
histogram X scale is linear.


>
> The s-shaped curve for increasing contrast is distinct from that.  I would 
> normally do that in the tone curve as this
> has the ability to handle saturation in an intelligent way (increasing it in 
> areas that are being brightened and
> decreasing it in areas that are being darkened).

I've noticed that the tone curve tool easily produces artificial-looking 
colors that base curve does not. In both case, saturation varies, but 
somehow different.

At least, from now on I know that base curve works on linear RGB data 
while tone curve works on perceptually uniform Lab data.

-- 
Stéphane Gourichon


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Darktable-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/darktable-users

Reply via email to