A new tool in Rawtherapee "Abstract Profile"

A new tool in Rawtherapee “Abstract Profile”

Since yesterday and commit 35abd92, the main branch “dev” contains a new concept “abstract profile”.

Three main uses - this “abstract profile” has 3 components:

  • TRC: adjust gamma and slope to: a) modify the image rendering which by default is g=2.4 s=12.92; b) raise the shadows and modify the lighter tones

  • Illuminant (white point): a) adjust the gamut of the Working profile to adapt it to the shooting conditions taking into account the colorimetry. b) used in conjunction with the primary modifications below.

  • Primaries: this is where the notion of “Abstract profiles” comes into its own. Several possibilities are offered: a) Use this module as a “Channel mixer” in order to achieve, if desired, special effects similar to “Color Toning”, with or without Ciecam; b) Use it to modify or refine the result of the Input profile to improve the colorimetry (calibration)

You will find most of the answers to questions you may have in the documentation. What is an “Abstract profile”, how does it work, etc.

Some components - in particular the “primary” part - are close in their principles to tools found in Lightroom, Darktable, ART,… but the implementation is totally different.

I want to thank Andy @Andy_Astbury1 for his excellent video on the first part « TRC adjustments »

I also thank @Lawrence37 @heckflosse @floessie for the code review work (bug, optimization, readability…), and Wayne @Wayne_Sutton for his advice, his listening and the translation into good English of the labels, tooltips and documentation.

I remain at your disposal for further explanations.



Jacques (and collaborators): You outdid yourself! This is a very nice, and another very powerful addition to RawTherapee.

I did notice the talk about this on GitHub and had a look at Andy’s video last night. I just now had a quick go at it and I’m rather gladly surprised.

As always one needs to figure out how it works exactly and when you can/need to use it. The Gamma and Slope sliders seem rather straightforward (especially after watching the video), the Destination primaries less so. That part needs some studying :wink:

Thank you all very much for this addition!

1 Like

This looks amazing! Thank you guys so much! :smiley:

@jdc: Some questions and remarks:

I have a question about resetting the sliders in Custom Primaries section (after setting Destination primaries: to Custom (sliders).

I noticed, after playing with the Rxy, Gxy and Bxy sliders that when you reset them they go to sRGB related numbers. But when I started they are set to ProPhoto related numbers. There seems to be a discrepancy there; I would expect them to go back to the original settings (The ProPhoto numbers in this case).

  • Is this something that still needs to be ironed out?
  • I’m expecting the default values, after resetting, to be related to the Working Profile that has been set. Is this assumption correct? The way it is now results in switching to a really bad looking starting point when resetting (most obvious when resetting all 6).

If you set Abstract Profile to Custom and dial in the Gamma and Slope settings, you then have a look at one of the other available settings and switch back to Custom again your previously dialled in Gamma and Slope settings are “lost”. To be more exact: They are set to the values belonging to the setting you switched to earlier.

  • Is this by design so that you can tweak the otherwise “fixed” values that belong to, say, BT709? I half expected to see my previously dialled in numbers.


For the second “gamma and slope”, it’s normal, because in all cases the mode “cutom” correspond to the last you have choose. For example, l you choose “Prophoto 1.8” and choose "Custom it is "prophoto 1.8 settings which appear as choices, and which you can modify, for example, change gamma to 1.9 or slope to 4.1…

Fo the first point, its the choice I have made. The GUI is extremely complexe . This brought a lot of code and quite complex optimizations especially by @floessie and @heckflosse. I have tested various solutions, but the “less bad” is the one that is in place, as the number of possibilities is impressive due to the fact that you can choose a destination profile different from working profile, or the same by changing primaries or illuminant (sliders or CIExy).
Wayne @Wayne_Sutton asked me some time ago, about a reset and my answer was what reset because it depends on what you want to do that the GUI can’t guess. To do a reset that returns the primaries and the illuminant to “default”, you must (re)select the same destination profile as “working profile”.

But thank you fo testing :slight_smile:


But I am open to a GUI change, if the reset is with only one choice

I assumed this was the case, just wanted to be sure. The way it is implemented seems more logical then my (half) expectation.

I can life with the way it is implemented at the moment.

There is another workaround to reset the sliders to their original: Switch to the Default setting and then back to Custom (sliders). Downside being that this resets all 6 sliders. Not that big of a problem.

I don’t think that is needed, certainly not at this point. Once this goes mainstream, and assuming many people will use it, a reason might surface that validates a GUI change, though.

Anyway: Thanks for your time/effort!

OK, but I will look to a general reset…(if it is possible simply)

I saw that sliders red, green, blue are reset to “AdobeRGB” primaries, while the default working profile is ProPhoto, I will change it (easy)



Done for sliders :slight_smile:


And again he shoots faster then his shadow :grinning:

Pulled, build and it works nicely.

That’s a much nicer solution and its more consistent with the default prophoto working profile.


1 Like

Hello Jacques and others!

Do I understand this right? Luminance estimation is done by CAM02 or CAM16 and that luminance is then changed when adjusting the TRC?



In most cases we act on the 3 channels R,G,B which are at their values at this moment of the process.

So we don’t only act on the luminance. Depending on the case, we use :

  • either a function of LCMS which calculates according to gamma and slope (TRC parameters) some parameters which will be passed to the virtual profile
  • or the new RGB values are calculated directly by applying gamma and slope (case where the user does not use the primaries)

The 2 values gamma and slope are used to calculate 5 parameters which allow the connection of the linear part and the parabolic part without discontinuities. This is the absolute condition to have a good result.

The values using cat02 or cat16 are only taken into account if Ciecam is activated, to elaborate the calibration if you want to change the illuminant of the input profile. This will change the RGB values, otherwise everything is the same as before.

Is this clear?


1 Like

Good job @jdc and friends! And quality explanations and documentation!

I just open a PULL REQUEST with a general Reset button

  • Set the “destination primaries” to the same value that “working profile”,(and set sliders primaries and illuminant to the destination primaries)
  • set gamma slope, preserv to default values
  • set general menu TRC to none



This part I don’t understand fully, but probably because I do not know enough about how RT works internally. But the TRC is not derived from a ciecam model if I understand you right. Ciecam is only used, in whatever version, for color adaptation transforms.

I think it’s clear. I’ll try to find something about the linear and parabolic parts of the TRC.
thank you so much!

While the term ‘abstract profile’ makes a lot of sense in the classification of profiles, it may be useful to think about a different name for the module, revealing more about the intended use. The name is pretty abstract (3a or even 1b). Has this been discussed elsewhere?

for info this is one of the 7 ICC profile types ColorWiki - The 7 ICC Profile Types

I found a PDF Building ICC Profiles - the Mechanics and Engineering that describes the abstract profile.

This profile may be used to perform some overall image affect and might normally be used in a link between other device profiles.


I have merge in “dev” the “reset” button



I have to say I think I agree about changing the name to something else besides abstract profile. Since there’s already a type of ICC profile that does LAB to LAB conversions (basically they are what cube luts are to RGB) it’s kind of odd to see something called “abstract profiles” where you load in the input and output color profiles. One would expect being able to load in that particular type of ICC profile given its location! I think the abstract profiles bit would be good in its own module, perhaps in the same tab as Retinex and CIECAM. Even if the name is kept, at least it wouldn’t be mixed in with the color profiles.

That’s just my two cents. Ultimately it’s not terribly important :upside_down_face:

1 Like