Bug with Working Space Tone Response Curve and bundled profiles

Hi everyone,

I’m actually revisiting a previous topic but I think a new topic is in order as the issues are somewhat different. I noted also that there is another somewhat relevant related thread to this.

My goal is to be able to analyse the falloff/vignetting of my lenses which is important for me to select the optimum aperture for astrophotography i.e. as wide open as possible while having falloff that is not too much. A friend initially discovered that vignetting information from all review sites we have scoured analyse the falloff after a tone curve is applied, or from OOC JPEGs, which also have some kind of “camera curve” applied. Imatest also gives the wrong suggestions for how to look at lens vignetting for this reason. So we have needed to perform our own analysis on linear data.

RawTherapee has the ability to “Save Reference Image” under the Color Management section of the Color tab. I note that the green channel’s numbers remain unchanged whether white balance is applied or not (I don’t apply it typically for this purpose anyway), and I am using the green channel’s numbers to calculate vignetting. There is no problem at all here. Everything works as expected.

For the sake of convenience, I would like to be able to not have to process and output TIFFs and just use the readouts within RawTherapee. Unfortunately, I cannot get the RGB readouts to match the “Save Reference Image” file.

  1. I initially assumed that by activating this function, which is “use working profile for the main histogram and navigator panel, otherwise gamma-corrected output profile is used” would allow me to see the RGB readouts which would match the “Reference Image”, i.e. linear data. Unfortunately, the values do not match. Why is this so?


  1. I see that the values increase instead of decrease when “use working profile” is checked. Why does this happen? At the moment, I’m thinking it is because a TRC of gamma 2.4 and slope 12.96 is used while my output profile is currently set as ProPhoto RGB, which has a gamma of 1.0.

  2. How then can I get the RGB readouts to match the “Reference Image”? I’ve also tried changing the TRC to Gamma 1.0 with slope of 0. This causes the RGB values to be slightly lower than the “Reference Image”, while the overall contrast is reduced, i.e. the ratio of the falloff in the corners to the center of the image is less, implying that the vignetting is less which isn’t the case. Since the “Reference Image” is definitely linear data, I’m now wondering if setting the TRC to gamma 1.0 isn’t really happening! How weird.

  3. The G channel value readout keep changing as I mess about with various settings, so something I’m doing is certainly not right. It should remain constant. I’ve also tried selecting “no profile” for the Input Profile, but alas it also does not match the “Reference Image”.

  4. I’ve probably overlooked something, but after messing about with this for a few hours and reading about how the Working Profile TRC:None works, everything is about as clear as mud. This TRC is independent of the tone curve which the input profile/camera profile has. When the Working Profile TRC is set to none, the preview is not of linear data; linear data looks much darker i.e. the “Save Reference Image”. However, the preview when Working Profile TRC is set to none is colorimetrically correct i.e. a photograph of a Colorchecker24 matches with the real thing/measurements of the real thing. I gather that this is a perceptually linear result, not linear data result, but I would like to be pointed to a clear explanation on this!

Here is a screenshot of the section of RT in question, I deeply appreciate any insight anyone can offer into my questions! Thank you!


Good question. I tried a few things and also failed to replicate the “reference” behavior. So a few things to note:

  1. Select “No profile”, because that is also what “Save Reference Image” bypasses (as per this: https://rawpedia.rawtherapee.com/Color_Management#Save_Reference_Image)
  2. Your selected output profile does not have a linear gamma. You should create your own output profile based on ProPhoto primaries, but with a linear gamma. You can do this with RT built-in ICC profile creator (top icon in the bottom left) and save it to your RawTherapee/profiles/output directory.

The output should be all right and match that of the reference TIFF. Haven’t checked the color picker behavior though…

Thanks Roel! With your tips, I was able to match the “Reference Image” G channel readouts by

  1. Selecting “No profile” as the input profile (as suggested)
  2. Using Prophoto Gamma 1.0 as the output profile (as suggested)
  3. Do not turn on the feature that uses the working profile for the readouts, i.e. this one:


However, why does it not work when I turn on #3 and choose Gamma 1.0 and slope 0 as the TRC for the working profile of Prophoto? In theory it should match the above. Maybe I’m missing something or maybe this feature is not working correctly.

@samuelchia Are you saying that pressing the button changes the export of your image? Or are you saying it doesn’t show you expected pixel values within RT?

@Thanatomanic No exporting of any images at the moment, yes, I mean it doesn’t show me the expected pixel values within RT.

I’m afraid I can’t help you further than this. Maybe @jdc or @heckflosse have an idea or can ping somebody else who knows more about what might be going on.

My thinking

When you “save reference image”, no color space transformation is applied to the camera RGB data as the data are taken at the beginning of the pipeline.

To get the same effect when using the complete pipeline , no color space transformation should be applied. So using for instance prophoto as working space:

  • generate a linear prophoto space ICC.
  • assign this linear ICC to the input profile: inputprofile/custom
  • use prophoto/TRC/none
  • use the linear ICC as output profile

The different transformation input->working and working->output should be identity.

remark : as @aurelienpierre demonstrated, processing must be done as possible in linear RGB space. I think that the possibility to assign a TRC to working space is useless and furthermore conterproductive as it can confuse users. It should be suppressed.

@gaaned92 I’m not having an issue with image processing, just to be clear. Also, I have been able to match the “save reference image” using the steps I outlined above, suggested by Roel. The input profile should be set to none, not linear Prophoto.

What I’m not understanding is why when the button to change the readouts to use the working profile is activated, and the working profile is linear (of course), the readouts do not match the linear “save reference image”.

1- [quote=“samuelchia, post:8, topic:18153”]
The input profile should be set to none, not linear Prophoto.
It seems it’s the same.

2- [quote=“samuelchia, post:8, topic:18153”]
What I’m not understanding is why when the button to change the readouts to use the working profile is activated, and the working profile is linear (of course), the readouts do not match the linear “save reference image”.

I test on an image with working profile=prophoto and output profile= linear prophoto.

  • the tooltip says If enabled, the working profile is used for rendering the main histogram and the Navigator panel, otherwise the gamma-corrected output profile is used.
    What means gamma-corrected output profile. Does it means that a gamma is applied to all output profile, even linear? If yes it would be rather stupid.
    It should be written : If enabled, the working profile is used for rendering the main histogram and the Navigator panel, otherwise the output profile is used.

when I toggle the button I observe that:

  • in the histogram cielab luminance and chromaticity doesn’t change OK as we are it seems in lab space
  • in the histogram, R, G, B change. It is a bug as we are in the same color space.
  • in lockable color picker and navigator values, RGB, LCH and LAB change when I toggle the button. well I really don’t understand what happens.

There are a few hypothesis:

  • It is a bug of the toggle button processing
  • the generated linear prophoto is not the same as the working prophoto. It is a bug or a bad use of the ICC generating tool to generate a linear prophoto
  • error in interpretation of what is happening. In that case, please explain me.

3- Other glitch. I have a calibrated display with a gamut which is about sRGB.
If I use the soft proofing button without printer profile , the tooltip seems to say that the image is viewed on the display using the current output profile (here linear prophoto) as display profile. That should generate an enormous difference. I see absolutely nothing happening on the display.
Is it a bug?

1 Like

@Thanatomanic I almost forgot to mention, thanks for the help!

Yes it gives the same result but for convenience, setting to none is easier and conceptually, this matches the way the “Save Reference Image” is handled. I suppose this is identical to the null profile trick used to trick printer drivers into printing with no colour management.

It’s just a tooltip, I assume it means to say that it will use the gamma encoding of the selected output profile, so if it is gamma 1.0, then you get linear data readouts, edit: except we don’t seem to be getting that at all when the gamma is set to 1.0

Agreed. If anything, tooltips should be as succinct as possible. Further details should be in Rawpedia.

Thanks for reproducing the issue! I assume this also happens for you when the Working Profile Tone Response Curve is set to Custom with Gamma 1.0 and Slope 0 (doesn’t matter really if Gamma is 1.0). It does sound like a bug.

I believe I’m using the one created by Elle Stone, which should not be a problem with the ICC profile.

I believe this is behaving as expected. The preview is showing correctly what the image will look like with the chosen output profile, so when invoking soft proofing with no printer profile set, the preview should not change.

I am now puzzled. I can no longer give sense to what I am doing with the working space TRC, the input and output profile and the toggle button.
It is late. will retest tomorrow with only elle stone ICC profiles and not the generated profiles.

1 Like

Thanks @gaaned92, get some rest and looking forward to any insight you might have!

Just to mention an edit to an earlier comment above -

It’s just a tooltip, I assume it means to say that it will use the gamma encoding of the selected output profile, so if it is gamma 1.0, then you get linear data readouts, edit: except we don’t seem to be getting that at all when the gamma is set to 1.0 (I previously accidentally said it works as expected, which it doesn’t!)

So after some rest, I did the following:

  • set the following prohotos profiles as working profile:
    bundled output profile: RTv4_Large.icc,
    Elle Stone linear: LargeRGB-elle-V4-g10.icc,
    generated linear: RTv4_Large_g1.000000_s0.00000.icc

warning: RTV4_large.icc is not linear.

  • use each as input profile, working profile and output profile.


  • as expected, use of RTV4_large.icc as input profile darkens the image OK

  • Elle and generated profiles used as working profile give same result as embedded prophoto OK

  • When applying linear TRC to working profiles: bundled output, ellestone linear and generated linear, display doesn’t change OK

  • when applying linear TRC to bundled working prophoto, display darkens. KO. It is a bug

Toggle button. I use “Elle stone linear” for input and output

  • with working profiles: bundled output, ellestone linear and generated linear, Histogram and displayed RGB, LCH or Lab values don’t change as expected . OK
  • with bundled working prophoto values change. KO it is a bug

So there is a problem using Bundled working prophoto.
I wait confirmation or infirmation of these conclusions.

I have now to test the output in good and broken configuration.

Now using soft proofing button.
As I understand the soft proofing as described in tooltip, the (simplified) pipeline is:
raw -> input profile -> working profile -> processing -> output profile -> viewing
But perhaps it is really:
raw -> input profile -> working profile -> processing -> output profile -> display profile ->viewing

Which is the actual pipeline for soft proofing?

@gaaned92 Thanks for testing this!

I’m trying to follow:

I can reproduce the same result on my end. BTW the tooltip says the TRC only affects bundled profiles, so it is working as claimed. Changing the TRC is supposed to change the preview for bundled working profiles, is it not? How is this a bug?

I can reproduce that also.

In addition to this:
Open any raw image
Input profile is default camera profile
Working Profile: Bundled Prophoto
Now toggle between Custom and None for the TRC where Custom is the “None” defaults of Gamma 2.4 Slope 12.96. The histogram changes when it should not. Another bug.

Is there any way to inspect the bundled working Prophoto profile? I cannot locate it within the RawTherapee installation folder. I’m now guessing it is hardcoded into RT.

@heckflosse perhaps you might have some insight into this, or know someone who might! Thank you!

Do you know what kind of TRC is it? It seems to be some kind of gamma shape but it is a 4096 point curve for the V2 profile, quite close to L* but slightly darker and has a linear segment near black.

I’ve submitted a bug report combining this issue as well as another: https://github.com/Beep6581/RawTherapee/issues/5753


I have the impression that when choosing the Working space for displaying histograms and pixel values, a TRC is applied giving the same values as with the bundled output prophoto which has a TRC!
All that seems borked to me.
The first step is really to suppress the TRC option to working space.

@gaaned92 I’m not fully sure what you are trying to say, sorry if I sound a bit thick.

The Nav panel display be default is showing you based on your chosen output profile, not merely the working profile. But then when choosing the working profile for the Nav panel readouts, it should use the TRC settings as they are set. It would be an issue if it always has to use the TRC of the output profile. It is good to have control over this independently of the chosen output profile.

What is weird to me is that when the TRC is set to “None”, it isn’t none but rather Gamma 2.4 Slope 12.96, so that is quite unintuitive to me.

I don’t understand what you mean by suppress the TRC option?

If you want to disabled this function, no problem…It is very easy

Of course, there will be no choice, no label
Under Woking profile
Tone response curve : will disapear, and also the 2 sliders