Gamma used by the exposure tab?

I understand RT uses a linear gamma in it’s working space, for good reason. Though the curves tools in the exposure tab all work in sRGB gamma. I have been going the code in curves.cc, but I still get in a muddle…

What I would like to understand properly is if I apply a straight line tone curve that maps

50% → 100%

25 --> 50 which would all be in sRGB gamma. A slope of 2.

like this Screenshot%20from%202018-01-27%2005-44-58

What should the values in linear gamma be? 50% and 25% in sRGB should be 18% and 4% roughly.

So what would the linear data look like in this case

18% → ?

4% → ?

Background I am working with some images that I have encoded using cineon/DPX scanning algorithm, and surprising it works much better than I expected, so now I am trying to figure out why :slight_smile:

1 Like

Afaik they work in the working space selected in colour management tab. Except the perceptual curve, which always works in ProPhoto.

Hi,

from what I understand, it depends on what you mean by “work” here. The shapes of the curves are defined in sRGB gamma, but the curves operate on linear data. References:

Also this from Rawpedia on working profiles -
Note that the working profile will only specify the red, green and blue primaries, gamma will not change as RawTherapee’s processing pipeline is floating point with no gamma encoding (that is gamma = 1.0). Some tools (like curves and histograms) will still display with a gamma (usually sRGB gamma) which is hard-coded for the tool and stays the same regardless of working profile.

Yes that’s my understanding but I was trying to get a better understanding of the function, if I did a simple operation where I mapped 50% to 100%, and 25% to 50%, or did 2 x slope operation, in sRGB, what is would look like in the working space.

I was basically trying to understand what the values of outCurve[i] would be if val was 100%, and 50% etc. I will put some printf in tomorow and report with the answer :slight_smile:

well roughly speaking, the formula (afaiu) is
out = igamma(curve(gamma(in)),
where igamma and gamma are defined in color.h

Uhm…
18%–>100%
4%–>21%
:thinking:

25%->50% srgb
0.25->0.5 srgb
0.25^2.2->0.5^2.2 linear
0.04->0.21 linear

Not sure if I follow those calculations thought I think I worked it out.

I think the correct answer is when I apply an operator to the sRGB data (using the tone curve), RT will just apply the gamma to the operator.

For example if I do simple slope operation where I increase all the sRGB data by 2. i.e. (2 X ) then RT will apply a slope operation where it will increase all the linear data, by 2^2.4 (roughly allowing for the linear portion of sRGB). So increasing all values by 2 in sRGB becomes increasing all values by 2^2.4=5.2, in linear space.

I will test this properly when, I have access to my other machine. Sorry if this is obvious.:blush: