Bug with Working Space Tone Response Curve and bundled profiles

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.

observations:

  • 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: Bugs with Working Profile Tone Response Curve · Issue #5753 · Beep6581/RawTherapee · GitHub

Thanks

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

Jacques

When “Local adjustments” wil be merge in DEV (soon), you will have a similar function in “tone equalizer TRC”, who does not use “Working profiles” to work.

This functions allows you to change gamma and slope in a RT-spot

jacques

Just throwing it out there, but I think one needs to take into account that the output profile, whether it is the calibrated display profile or the profile exported with a file, applies its own TRC, built to accommodate the needs of the rendering medium. Anything you do before that is for “s…s and giggles”, or maybe more graciously put, “artistic intent”.

I can be unclear as English is not my naive langage

It is a bug
I think that the working profile is linear in this case but the values and histogram are displayed using a prophoto TRC

When choosing a linear TRC with the embedded prophoto working profile, processing is destroyed ==> other bug.
Furthermore, I think this option is of very little use or even conterproductive as asserted by @anon41087856.
So my suggestion was to delete the working profile/tone response curve option. But this has to be validated by devs and backward compatilbility taken into account.

If it is done at the end of pipeline, it is an artistic function like ASC/CDL. But changing the TRC of the working space has an impact on the whole pipeline with all processing performed in non linear space.

@jdc Just to be very clear, myself I am not calling for this function to be disabled. Rather I am having some issues with how it works. It also is causing problems with highlight reconstruction as reported in the other thread mentioned earlier.

I’m not entirely sure the purpose of this function either. Perhaps a re-design is in order, rather than the total elimination of this control.

Well, in that case, then when the Navigator histogram and readouts are switched to use the working profile for display, will it show readouts for linear data or with this TRC of gamma 2.4 and slope 12.96 applied?

What is an “RT-spot”?

I assume it is avoided by leaving the TRC setting to “none” for now.

I’m not familiar with this assertion you refer to?

@samuelchia

In all cases, Rawtherapee does all its work with a gamma=1

it is at the end of the treatment that a TRC is applied

  • either if you used an Output profile
  • either if you used your screen (in all cases)

If a “screen profile” is installed , TRC of this profile is used (generally g=2.4 s=12.92)
if not, an TRC is applied with g=2.4 s=12.92

The possibility tu use “free TRC” with working profile, assumes that by default a gamma=2.4 and s=12.92 is applied…at the end.
In this case a correction is applied (after working profile is applied), for RGB and Lab threatment.
for example, no action on white balance, no action on input profile…

I understand it seems complex, but in fact, it is very simple…

RT-spot, is the basic concept of local retouching (Local adjustments), now in branch “newlocallab2”, which will be merge very soon

@jdc Thank you for the explanation Jacques! This is consistent with everything I knew previously about the function of this TRC setting, but it is very good to have confirmation once again.

Unfortunately, the “free TRC” function seems to not be working properly. When I set it to Gamma 1.0 slope 0, it gives unexpected results (it isn’t showing gamma 1.0) and it also affects the highlight reconstruction algorithm when it should not. I have filed a bug report on Github highlighting these issues.

Not so sure I understand this correctly. So if I set the TRC to something other than “none”, let’s say I use gamma=1.0, is a gamma of 2.4 and slope 12.92 still applied at the end? Why does that happen? Are you referring to the screen display when you say this? Otherwise shouldn’t it only use my settings of gamma 1.0 and then apply the TRC of the output profile (I’m referring only to what’s happening to the file being processed and saved out of RT, not what I’m seeing on my monitor)?

Good to know!

Is there any practical purpose to this function? For normal photographs, there doesn’t seem to be a need but I imagine it can be useful for some types of analysis work, and if so, it should not be removed. In my case, I want to have linear gamma=1.0 RGB readouts in the Navigation panel. This function should be able to give me that. Unfortunately, it is broken in its current state.

Maybe there is a better way to design the UI to be more intuitive but I haven’t put any thought into that yet.

In countless posts, @anon41087856 mightly asserts that processing must be done in a linear RGB space (surely with the exception of artistic functions).

In Toolchain Pipeline - RawPedia, I suppose that step 7 convert color space refers to the conversion from camera space to working space and step 12 Tone response curve refers to the application of the TRC defined in Working space/TRC custom.
So if a non linear TRC is defined in workingspace/TRC, the rawpedia pipeline page shows that whole RGB pipeline is performed in non linear space.
@jdc could you clarify, and if required correct accordingly rawpedia. thanks in advance.

I cannot really understand.
A TRC is applied in step 12 (see above) so at the beginning of processing and not at the end.

If you refer here to the conversion from Working space to display profile or output profile, I really hope that the embedded TRC of the profile is used.

@jdc could you please make clear used to what? and applied to what?
If there is no screen profile installed you need also other informations
If no display profile is defined in Rawtherapee, what color space is used by Rawtherapee to display previw, thumbnails…? images.

Hmm, you make it sound like some kind of gospel truth from Aurelien. Processing of raw images isn’t done in linear RGB because Aurelien says so, it is that way because it is optimal and was certainly known before Aurelien asserted it.

Correct me if I’m wrong, RawTherapee has been processing raw images in linear space for almost a decade already.

I think he already answered this here:

Thanks

So the answer is Rawtherapee does all its work with a gamma=1 except if a Color” / “Color management” /“Tone response curve” with gamma and slope has been choosen.
Thus

could be wrong

And that is definitively a wrong statement as well as old.
https://community.acescentral.com/t/why-grading-in-log-instead-of-linear/2228/7
http://help.autodesk.com/view/FLAME/2020/ENU/?guid=GUID-F864483A-EF62-444D-B82E-842C31BA70F5

Operations that work best in linear
-white balance/exposure
-blur
-sometimes resizing

Operations that work best in log or gamma
-many tone manipulation operations
-unsharp mask
-grain and noise operations
-sometimes resizing

Modern colour correcter tend to develop into the direction that each operator is operating in the space appropriate for its design goals.

1 Like