Difference between revisions of "Color Management"

(Use of data from the "CIE xy" diagram in Abstract profiles.)
(Use of data from the "CIE xy" diagram in Abstract profiles.)
Line 190: Line 190:
* the 3 primaries: Red, Green & Blue
* the 3 primaries: Red, Green & Blue
* the white point
* the white point
If the first combobox in the ‘Abstract Profile’ panel is set to any option other than ‘Custom’, the CIE xy diagram will display
If the first combobox in the ‘Abstract Profile’ panel is set to ‘Custom’ or others options (BT709...), the CIE xy diagram will display
* the primaries and the white point of the profile selected in the ‘Destination primaries’ combobox
* the primaries and the white point of the profile selected in the ‘Destination primaries’ combobox

Revision as of 10:54, 23 April 2021

Color Management

1 Input Profile

A raw file contains a dump of light values captured and quantized by the sensor and related electronics. The input profile's role is to accurately map these values into a known color space to ensure that all colors in the captured scene are faithfully reproduced. The input profile is applied to the image data at the beginning of RawTherapee's processing pipeline, and most tools process data downstream in the pipeline.

For detailed information, see:

1.1 No Profile

No input color profile will be applied. The color matrix will use "1" along the diagonal and "0" everywhere else.

  • Raw files will show the camera's native RGB color. They will only be demosaiced and white-balanced.
  • Non-raw files will be displayed without any embedded input profile applied, including no gamma correction, which means they will look bright.

This feature is generally only useful for didactic and scientific purposes. For example if the camera has recorded colors far outside of the conventional gamuts, using no input profile ensures that no color clipping occurs.

1.2 Camera Standard

RawTherapee looks for the color matrix in three places:

  • In the dcraw code which is embedded inside RawTherapee,
  • In the raw file itself,
  • In a text file on your system which is installed with RawTherapee called camconst.json

Information is gathered from all three places, and values from camconst.json are prioritized above those from other sources. There is an exception for the input color matrix, in that if the raw file is in the DNG format and the Software Exif tag (0x0131) does not begin with the string "Adobe DNG Converter" and the file does contain a ColorMatrix2 tag, then the value from this tag is prioritized.

A color matrix is a matrix of 3x3 constant values which is multiplied with the camera's native RGB colors to convert them to colors which are as faithful as possible. A color matrix works best (i.e. provides most accurate colors) when the white balance is close to what the matrix was calibrated for. The "camera standard" matrix is calibrated for D65, i.e. 6500K. Do not worry if the white balance is quite far off from that, as colors will be reasonably accurate anyway.

For applications where the most accurate and fine-tuned color is not of highest importance, such as landscape photography, the color matrix will provide good colors. An advantage of color matrix processing, as opposed to lookup table-based DCP and ICC conversions, is that it's purely linear, i.e. dark and bright colors of the same hue and saturation are translated the same way. This makes it robust and may be the best choice if you will be exporting images for processing in an HDR application or other application where a predictable linear color response is required.

1.3 Auto-Matched Camera Profile

Uses a DCP or ICC input profile. DCP profiles are prioritized. These profiles can provide more accurate colors than the standard matrix.

These profiles are meticulously created by us, using photos of color targets submitted by users. If you have access to a color target and we do not yet have a dual-illuminant DCP profile for your camera (see [1]), then submit the required photographs so that we may improve color accuracy for your camera model. You will find instructions in the article titled "How to create DCP color profiles".

If neither a DCP nor an ICC profile is available for your camera model, RawTherapee will revert to the camera standard color matrix.

Camera profiles work in the normal range, from black up to clipping. If you enable highlight reconstruction, new data is added above the clipping level and if you bring it into visible space (by negative exposure for example), that range will not be naturally covered by the profile. However, RawTherapee will linearly extend the profile to cover this range too - colors there will get the same correction as the brightest colors of the same hue and saturation in the normal range.

1.4 Custom

Specify a custom DCP or ICC camera input profile.

If RawTherapee does not have a DCP profile for your camera model and you do not have access to a color target, one place where you can get a profile from is Adobe DNG Converter. See the article "How to get LCP and DCP profiles" to learn how to get them.

DCP is a format specially designed for camera profiles and RawTherapee should support the most recent DNG standard (which defines DCP), so you can for example use DCPs provided by Adobe's DNG converter. ICC profiles, on the other hand, are more tricky. ICC profiles can be used for a multitude of purposes (printers, displays, etc.) and since they're not designed specifically for camera profiling, different vendors have chosen different approaches for their ICC profiles. In practice this means that the input image must be pre-processed in some specific way for the profile to work. The profile itself lacks information on how to do this, which means that if you are using a third-party profile RawTherapee may not necessarily do the expected pre-processing - results may vary.

1.5 DCP

1.5.1 DCP Illuminant

Some of RawTherapee's profiles are single-illuminant (Daylight/D50), while others are double-illuminant (Daylight/D50 and Tungsten/StdA). If a dual-illuminant profile is loaded the "DCP Illuminant" setting will be enabled and you can choose which illuminant to use. The actual DCP standard (part of the DNG standard) does not provide this choice, but instead an interpolation between the two illuminants is calculated based on the chosen white balance (there will only be an interpolation if the white balance is in-between both illuminants, otherwise the closest is picked). This "interpolated" mode is the default setting of "DCP Illuminant" and for any normal use you do not need to change this.

You can however choose to base the color rendering on one of the specific illuminants. In some cases this might produce more pleasing color. It can also be interesting for diagnostic purposes to see how large (or small) a difference there is in color rendering between the illuminants, but, as said, for general use this setting should be untouched.

1.5.2 DCP Tone Curve

Some DCPs contain a tone curve which may be used to add contrast and brightness to provide a film-like look. This is mainly used for profiles simulating camera maker settings. The tone curve checkbox will be disabled for profiles which do not contain a tone curve.

The curve mode used by the DCP tone curve is the same as the Exposure tool's "film-like" mode, meaning you can reproduce the effect using the Exposure tool's tone curves in film-like mode. When contrast is applied with a film-like curve the appearance of the colors will change and overall saturation is increased, except for bright colors which instead are de-saturated. Some profiles which have curves embedded are pre-corrected for this color appearance change and will thus not provide the intended look without the curve applied. Most will however work well without the tone curve applied especially if you add a similar curve yourself using the Exposure tool's curves, but if you want to see exactly how the profile designer intended the colors to look you should enable the tone curve.

While the input color profile is applied at the first stages of the toolchain pipeline, the DCP tone curve is applied later in the pipeline at some point after the Exposure tool.

The tone curve used in some of RawTherapee's bundled DCPs, DCP tone curve.rtc

The curve used in some of RawTherapee's bundled DCP profiles is the same as the default curve used by Adobe Camera Raw. You can get the curve from this file: File:DCP tone curve.rtc
Set either tone curve in the Exposure tool to "Standard", set its mode to "Film-Like", and then use the Folder-open.png "Load a curve from file" button to apply DCP tone curve.rtc

If the DCP profile has a copyright tag with the value "Adobe Systems", regardless whether it contains a tone curve or not, RawTherapee will automatically create a tone curve shaped identically to the Adobe Camera Raw curve. The reason for this is so that using the DCP in RawTherapee can match the results of using that DCP in Lightroom. This is why the "Tone curve" checkbox will not be grayed-out when using a DCP profile which has no embedded tone curve, as long as it has the copyright tag set as described.

1.5.3 DCP Base Table

This enables the DCP "HueSatMap" lookup table which is used to add non-linear corrections on top of the basic matrix. This is an advanced user setting and unless you want only the pure matrix result should leave it on. It's grayed out if the loaded profile lacks a HueSatMap table.

1.5.4 DCP Look Table

This enables the DCP "LookTable" lookup table which is intended to add a subjective look on top generally together with an embedded tone curve. That is if you disable the DCP curve and looktable you may get a neutral "colorimetric" profile, if the DCP was designed that way which is not always the case (if the DCP has both a look table and a base table it's likely that it is, but if it only has a look table it will probably not work well with it disabled). Disabling individual DCP elements are considered advanced user settings, normally you would leave this on.

1.5.5 DCP Baseline Exposure

The DCP may indicate an exposure offset that corresponds to an offset of the exposure slider. The purpose of this is typically to make the brightness of the image match the brightness of the camera's own JPEGs, which can be useful if you're shooting with auto-exposure. Currently this offset is applied "under the surface" so you don't see it on the exposure slider.

Note that if you are using Adobe's proprietary profiles those are expecting that the DNG's "baseline exposure" tag is applied too (the profile's offset is added on top). Currently there is no support for the DNG tag so you need to find that out on your own (using exiftool for example) and then set that offset using the exposure slider if you want to get the exact same brightness as in Adobe Camera Raw.

1.6 Implementation Notes

1.6.1 Third-Party DCP Support

The DNG Camera Profile, DCP, is the preferred camera input profile format for RawTherapee. All elements of the 1.4 DNG specification are supported, with the exception of the black render tag (see below). A DCP can be a pure matrix profile, it can have a LUT (typically 2.5D) to improve the colorimetric accuracy, and then it can have an embedded curve and a separate "look table" on top. It may also add an exposure offset. All these elements can be toggled on/off via checkboxes. However, you should be aware that a profile will produce the most accurate colors when all the elements it was designed to include are enabled. For example, using a tone curve changes the color appearance, so if you disable an embedded tone curve to get a linear profile you can't count on the colors being absolutely accurate. Nonetheless, most photographers rely on an aesthetically-pleasing appearance, and not on absolute accuracy, so this should not be a concern unless absolute accuracy is crucial. Typically, third-party profiles would come from Adobe Camera Raw/Lightroom/DNG Converter, and RawTherapee supports them. Many of Adobe's profiles lack a tone curve, but in Adobe's world that does not mean that no tone curve should be applied, but that Adobe's default curve should be applied. RawTherapee will therefore identify Adobe profiles (from the copyright string) and add the default curve to those (which you can toggle with the tone curve checkbox).

Adobe DNG Converter may add a "baseline exposure" to the DNG file. Some of Adobe's DCPs are designed to work with that baseline exposure and then produce a default output which is about the same brightness and contrast as the out-of-camera JPEG. RawTherapee can honor this baseline exposure if the DCP contains one.

The DCP format also has a black render tag. This indicates if the raw converter should do "automatic" black subtraction or not. RawTherapee ignores this tag - you can perform manual black subtraction with the Raw Black Points tool or with the black slider in the Exposure tool. As many of Adobe's profiles indicate auto black subtraction and Adobe Camera Raw/Lightroom does it, in those cases RawTherapee will render slightly lower contrast and brighter shadows.

1.6.2 Third-Party ICC Support

RawTherapee has specific support for ICC profiles bundled with Capture One and Nikon NX2, so those should work well. Older ICC profiles are not likely to work well though (typically the image becomes extremely dark with unsupported ICC profiles).

Some ICC profiles apply a tone-curve and desaturate bright highlights for a more film-like look. Those profiles may not work well together with Highlight Reconstruction. If you see a radical change in contrast when you apply your ICC profile, it has applied a tone-curve and then you should not use it together with Highlight Reconstruction.

Unlike DCP profiles, ICC profile processing may cause clipping of extremely saturated colors during conversion. In practice this is rarely a problem, but still DCP should be considered the primary choice if available.

Note on using Capture One ICC profiles: RawTherapee applies the ICC before exposure adjustments, as the intention is that input profiles should only be used to make the colors more accurate, and not to apply a look - you design the look using the tools instead. Phase One's ICC profiles contain a subjective look though, which means that they typically contain "hue twists", for example saturation in the shadows is increased. This means that if you have an underexposed file and push it a few stops, those hue twists have been applied to the dark image before the exposure adjustment and will thus be in the wrong place after adjustment; that is you don't get the same look as in Phase One's Capture One. Therefore it is recommended to have the right exposure out of the camera when using Phase One ICC profiles. You should also apply a suitable RGB film-like curve, as those ICC profiles are designed to be used together with that.

We are aware that LUT ICCs should typically be applied after exposure (just as DCP LookTables are applied), and that would support for example Capture One profiles better. This may be fixed in a future version.

1.7 Save Reference Image

Clicking the "Save Reference Image" button saves a linear TIFF image before the input profile is applied. This file can then be used for profiling, i.e. creating a camera input profile. You can use the open-source ArgyllCMS program to create ICC profiles, and DCamProf to create ICC or DCP profiles.

Cropping, resizing and transformations (rotation) will be applied, allowing you to make the output image more manageable by the receiving software. ArgyllCMS is very picky for instance, and requires that only the test target is visible in the image.

You can also choose if you want to export with white balance applied or not. For ICC profiles you should export with white balance applied, but if you intend to make a DNG profile or a dcraw-style color matrix you should export without applying white balance.

2 Working Profile

The default working profile is ProPhoto and should not be changed for normal use.

The working profile specifies the working color space, which is the color space used for internal calculations, for instance for calculating saturation, RGB brightness/contrast and tone curve adjustments, chrominance, etc.

When RawTherapee was based on integer math it was wise to not use working space larger than absolutely needed to get the best precision in the calculations. However, RawTherapee had switched to floating-point processing in 2011, and since version 4.0.12 the default working profile is ProPhoto, which has a very large gamut.

The choice of working profile has an influence on the effect of the curves in all modes except for perceptual - in that mode, changing the working profile will not alter the effect of the curve. If you have trouble fitting colors within the output gamut you can experiment with changing the working profile when using curves in any mode but perceptual.

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.

2.1 Adding Custom Working Profiles

RawTherapee 5.5 allows you to specify custom working profiles through a JSON file. The file should be named workingspaces.json and it can reside in:

  • the ICC profile folder as set in Preferences > Color Management > Directory containing color profiles,
  • or in RawTherapee's own ICC profile folder:
    • Windows: <rt-install-folder>\iccprofiles
    • Linux:
      • When installed using your package manager or self-compiled with BUILD_BUNDLE=OFF: /usr/share/rawtherapee/iccprofiles
      • When self-compiled with BUILD_BUNDLE=ON: <rt-install-folder>/iccprofiles
    • macOS: /library/ColorSync/Profiles/Displays

The format of workingspaces.json is as follows:

{"working_spaces": [
        "name" : "ACES",
        "file" : "/path/to/ACES.icc"
        "name" : "ACEScg",
        "matrix" : [0.7184354, 0.16578523, 0.09882643, 0.29728935, 0.66958117, 0.03571544, -0.00647622, 0.01469771, 0.66732561]

If "matrix" is present, "file" is ignored. If only "file" is present, the matrix is extracted from the ICC profile. For this, RawTherapee looks only at the R, G, and B matrix columns and the white point set in the profile. Bradford adaptation is used to convert the matrix to D50. Anything else in the profile (LUT, TRC, etc.) is ignored.

It is the user's responsibility to ensure that the profile is suitable to be used as a working space.

3 Abstract profiles - under development – April 2021

3.1 What is an Abstract profile?

  • According to the International Color Consortium (ICC), Abstract profiles allow you to perform custom image effects, such as applying a particular “look” to a series of images. Such a profile allows you to define CIELAB (or CIEXYZ) values as both Input and Output. Thus you can algorithmically define colour changes of whatever type you like and produce the LUT that achieves that. A small number of color management applications support the creation and/or use of Abstract profiles.
  • In the case of Rawtherapee this is achieved using the Virtual profiles in LCMS, which allow you to modify the data using the same algorithms and principles as those used for "Input profiles" or "Output profiles" i.e. by acting on one or more of the 3 ICC profile components: Tonal response curve (TRC), Illuminant (white point) and Primaries.
  • Is an Abstract profile part of color management? This is debatable but it is certainly more so than the Working profile, which is simply a transformation in C++ code that converts RGB data into XYZ. If we use the ICC and LCMS (virtual profile) definitions, the answer is obviously yes.

3.2 The CIE xy diagram

The LCMS virtual profile modifies the "x", "y" data which is one of the possible representations of the colorimetry. This representation makes it possible to easily see:

  • the limits of human sight in terms of visible frequencies from 380nm to 770nm
Limits of human vision
  • a triangular color-space model based on the primaries
Colorimetric spaces
  • the curve showing the evolution of the white point (one of the bases of the illuminants D50, D65, Std A, )
White point
  • Note that this representation must be interpreted with care, because it is a vertical projection of the gamut. A color that is outside the triangle of the gamut is necessarily out of gamut, but a color inside the triangle can also be out of gamut, because this projection ignores the luminance component.

3.2.1 Some "Primary" values

  • sRGB - Red x=0.64 y=0.33 - Green x=0.30 y=0.60 - Blue x=0.15 y=0.06
  • Rec2020 - Red x=0.708 y=0.292 - Green x=0.17 y=0.797 - Blue x=0.131 y=0.046
  • ProPhoto - Red x=0.7347 y=0.2653 - Green x=0.1596 y=0.8404 - Blue x=0.0366 y=0.0001
  • ACESp0 - Red x=0.7347 y=0.2653 - Green x=0 y=1.0 - Blue x=0.0001 y=-0.077

When one of the primaries is outside the limits of human vision we speak of imaginary colors.

3.3 Use of data from the "CIE xy" diagram in Abstract profiles.

Abstract profiles

You can act as you wish on the 3 components of the virtual profile. The screen capture represents the configuration when you want to improve the "calibration" of the Input profile.

  • In this example, the Working profile is Prophoto, where the primaries have not been modified . When you choose "Destination primaries: Custom" the algorithm will choose - by default - this particular Working profile to build the virtual profile.
  • If you change "Destination primaries:" to any other value than "Working profile" you will generate special effects such as "Color Toning" or those produced with a "Channel Mixer.
  • If you change "Illuminant:" D50, to another value, either you want to create or amplify some special effect, or you want to adapt the illuminant for a specific use.

If the first combobox in the ‘Abstract Profile’ panel is set to ‘Custom’, the CIE xy diagram will display the default working-profile values. i.e:

  • the 3 primaries: Red, Green & Blue
  • the white point

If the first combobox in the ‘Abstract Profile’ panel is set to ‘Custom’ or others options (BT709...), the CIE xy diagram will display

  • the primaries and the white point of the profile selected in the ‘Destination primaries’ combobox

In addition to the profile options in the ‘Destination primaries’ combobox there are also two custom options:

  • Custom (sliders)
    • the sliders Red (X Y), Green (X, Y) & Blue (X, Y) will be active
    • the combobox ‘Illuminant’ will be active
    • any changes to the slider values will be shown in the CIE xy diagram. Note that the ‘Custom (sliders)’ option does not allow you to make changes directly on the graph.
  • Custom (CIE xy diagram)
    • you can modify the primaries directly on the graph using the mouse and the changes will be made automatically to the Red, Green & Blue sliders. Note that in this case you can only modify the slider positions by moving the points on the graph.
    • the illuminant cannot be changed

Note: the diagram is given for information only - the limits are not always very precise, especially towards the greens.

3.4 Which data and profiles are used or modified?

The Abstract profiles (Virtual profiles) implemented here:

  • do not change the Working profile
  • do not modify the Input profile
  • do not modify the Output profiles
  • but they modify the data in the same way as any other Rawtherapee algorithm. Particular features:
    • the Abstract profile, which corresponds to a virtual ICC profile in LCMS, acts as a patch at the end of the process (just before Ciecam and just before the conversion to a screen profile or an Output profile). It acts on the 3 components of an ICC profile (Tone Response Curve, Illuminant (white point) & Primaries). Depending on the choices and settings, the image appearance can be modified as follows:
      • in depth by acting on the distribution of luminance and colors – rather like a Channel Mixer or Color Toning to which an extra dimension has been added.
      • only on the luminance distribution via the TRC, either to change the default aspect which in Rawtherapee is an sRGB TRC, or to act as a Shadows/Highlights control.
      • to modify or refine the results of the Input profile with the help of a color chart (Colorchecker24 or other), either with the same illuminant that was used during the elaboration of the Input profile, or with another illuminant. In this case Ciecam will need to be used also.

3.5 Three main uses (with or without Ciecam)

  • TRC: adjust gamma and slope for various purposes. a) modify the rendering of the image which by default is g=2.4 s=12.92; b) raise the shadows and modify the lighter tones while preserving the colorimetry and the gamut.
  • Illuminant (white point): a) adjust the gamut of the Working profile to adapt it to the shooting conditions. In this case, we will pay particular attention to the colorimetry. If an image is taken at 4000K, in sRGB (which is D65), the gamut may not be suitable. The joint action of the "illuminant" and Ciecam (symmetrical mode) allows you to ensure good chromatic adaptation; 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).

3.6 Where is it located in the Rawtherapee process?

It is located at the end of the process - just before Ciecam - and thus allows the user to either:

  • apply special effects at about the "same level" as "Color toning - Color corrections regions".
  • make color corrections (calibration) at the end of the process just before the Output profiles taking into account the image modifications made upstream.

This position also avoids the introduction of non-linearities.

3.7 TRC - Tone Response Curve

This feature allows you to vary the gamma and slope based on the Working profile. It does not modify this profile, but takes its characteristics into account. It is applied at the end of the process, just before Ciecam. It can be found in other software such as UFRaw ©, as well as in Output profiles.

It has several objectives:

  • Educational: you can see the main differences resulting from changes in gamma (g) and slope (s) directly on your monitor. For example:
    • a standard gamma = 1.8 - used as an Output profile by Prophoto,
    • a standard gamma = 2.2 - used in Output profile by AdobeRGB,
    • a TRC - "BT709" which corresponds to gamma = 2.22 and slope = 4.5. This has a linear part "up to 4.5", then a logarithmic part with g=2.22. This combination gives the same result as the "standard gamma = 1.8" for the medium tones and highlights, but has improved shadow rendering by removing the impression of grayness.
    • a TRC - "sRGB" which corresponds to g=2.4 and s=12.92. This has a linear part "up to 12.92", then a logarithmic part with g=2.4. This is the usual rendering chosen by many software applications including Lightroom ©, as well as the default screen output and output of Rawtherapee.
    • etc.
  • Particular export requirements: you can decide to work with a linear gamma for example, for exporting to another software application (for printing, or for modification in Photoshop or Gimp) and/or to see the results directly on your monitor.
  • Action on shadows and highlights: this feature does not replace the other Rawtherapee modules such as "Shadows/Highlights", or the curves in "Exposure", etc., but is complementary to them:
    • you can lift the shadows by using the "Slope" slider. Values up to 300 allow a significant transformation of the image in the shadows.
    • you can act on the highlights and mid-tones by acting on the "gamma" slider. Values up to 15 are possible.
    • You can observe the impact on the histogram.
  • adjust the luminance of the gray tones, for example when using a ColorChecker24 for calibration.

3.7.1 Differences compared to a classic tone-curve

  • as previously mentioned, it is located at the end of the process to avoid non-linearities as much as possible and guarantee better quality results.
  • when used in conjunction with "Illuminant" or "Primaries" it guarantees that the result stays in gamut and gives better colorimetry. When it is used on its own (with Illuminant and Destination set to the default values), there is no gamut control (to optimize processing time). Changing any of the default values will immediately invoke the gamut control.
  • the linear part, often with a small value (s= 2 ... s=13), connected to a parabolic part is practically impossible to realize with a tone-curve.
  • it constitutes - as soon as you activate "Illuminant" (if only to confirm the illuminant, for example D50 for ProPhoto), or "Primaries" - a part of a virtual ICC profile that can be applied at the end of the process to an image or a series of images

3.8 Illuminant - white point

By default the illuminant is set to the corresponding value in the Working profile. For example this corresponds to D50 for "ProPhoto", D65 for "sRGB", D60 for "ACESp1".

White point

Why change it? There are several reasons for wanting to change this value:

  • to voluntarily change the colors as you would with a "Channel Mixer" or "Color Toning". If we examine the "CIE xy" diagram, we can see that when we change the illuminant the white point moves:
    • towards the red zone if the temperature of the illuminant drops,
    • towards the blue zone if the temperature of the illuminant increases.

Used this way we are essentially modifying the red / blue balance.

  • to "patch" the Working profile and adapt the colorimetry to specific images. For example, let's imagine that we took pictures around dusk and that the Working profile is "Prophoto" with a D50 illuminant.
    • let's set the illuminant to D41 - the smallest listed value of daylight illuminant - which may be similar to the actual illuminant when shooting.
    • don't touch anything else.
    • the virtual profile will "patch" the data by changing the XYZ values of the RGB-XYZ conversion matrix to better fit the image data, thus avoiding out-of-gamut values.

3.9 Primaries

By default the primaries are set to the values of the Working profile, so why change them?

  • to create special effects similar to those that can be produced in the Channel Mixer or in "Color Toning"- note that a "primary" Channel Mixer is a little more intuitive than an "RGB" Channel Mixer in the sense that the action on a primary acts mainly on the particular primary color - in this case there are two possibilities:
    • you can choose a set of primaries which are different to those used in the “Working profile” by selecting a different profile in the drop-down list in the “Destination primaries” combobox. This will have the effect of moving the triangle on the “CIE xy” diagram to take into account the difference between the primaries in the “Working profile” and the primaries used in the “Destination primaries”. This introduces a constant shift in any images to which this “patch” is applied. The final result will of course depend on how the colors are distributed in each of the images.
    • you can also adjust the primaries individually by selecting “Custom” in the drop-down list in the “Destination primaries” combobox . In this case you can modify the location of the 3 vertices of the triangle of “Destination primaries” giving you almost unlimited possibilities.
  • to modify/refine images so that they are as close as possible to the shooting conditions ( deltaE minimized).
    • the use with a chart (ColorChecker24 ...) is almost mandatory.
    • Ciecam should be used if we want the Input profile to be relevant when used with an illuminant other than the one used to develop it.

3.10 Possible example of use to modify/improve the behaviour of the Input profile

  • switch to "Neutral”,
  • load the image of the chart that was used to create the Input profile,
  • choose “Abstract profile" - and "Custom". By default the selected profile will be the same as "Working profile" (as will the illuminant). Do not change these values.
  • select "Custom" in "Destination primaries”,
  • the Working profile primaries are displayed, you can now modify them,
  • activate the lockable color picker,
  • select among the patches: 2 or 3 grays distributed between the darkest and the lightest, 1 red (saturated), 1 green (saturated), 1 blue (saturated),
  • the L*a*b* values of these patches (chart references) are the target values,
  • adjust gamma (g) and slope (s) so that the 3 grays are as close as possible to the reference values,
  • change the "x" and "y" values of the "red", "green" and "blue" primaries so that the measured values are as close as possible to the reference values,
  • use "Preserves Pastel tones" if necessary: this slider allows you to avoid modifying very lightly saturated tones (close to neutral tones) and allows you to progressively reduce the action on pastel tones,
  • save the result.

If you want your profile (e.g. developed in D50) to be used for another temperature range. It is necessary to take Cat16 into account in Ciecam:

  • choose the new temperature in "White balance" - for example 6000K,
  • select "Color Appearance & Lighting (Ciecam02/16),
  • select: CAM Model > CIECAM16,
  • select CatO2/16 mode > “Automatic symmetric”,
  • Adjust the temperature in "Viewing conditions" to that of the white balance (in this example 6000K),
  • then use the same process as before.

To use the results of this virtual profile for other images, do the following:

  • on the thumbnail in the file browser - right click - "Processing profile operations", "Copy"...then "Paste partial" "Color management".

Note: Of course, the values can also be adjusted empirically as in ART and Lightroom. For small deviations from the original primaries, the results are fairly predictable. On the other hand, if we make big changes, the results will be less so.

4 Output Profile

Specify the output color profile; the saved image will be transformed into this color space and the profile will be embedded in the metadata. The effects the output profile has on the image cannot be seen in the preview.

RawTherapee lets you specify "input" (e.g. you're camera's profile), "display" and "output" (i.e. printer) device class profiles with an RGB color space, because RawTherapee saves only RGB images. Profiles listed in this combobox are those which come bundled with RawTherapee and those located in the folder set in Preferences > Color Management.

The soft-proofing feature is dedicated to simulating printer rendering. It lets you preview what your image will look like when printed, assuming you use a printer profile which correctly simulates your printer and paper combination. For best printout quality, after you have tweaked your photo using soft-proofing, you should select your printer profile as the output profile and save the image using it. This ensures that the image is encoded using your printer's color space directly from RawTherapee's internal high quality floating-point representation, instead of being saved to an 8-bit image in sRGB for example and then having to be subsequently converted to the printer profile, which would be quite lossy.

The main histogram, navigator and clipping indicators will use either the working or the output profile, depending on your setting in Preference > General.

RawTherapee comes bundled with a number of custom-made high quality output profiles:

Similar to sRGB
Gamma close to sRGB: g=2.40, slope=12.92
Similar to sRGB
Gamma BT709: g=2.22, slope=4.5
Similar to sRGB
Linear gamma g=1.0, slope=0
Similar to AdobeRGB1998
Gamma close to sRGB: g=2.40, slope=12.92
Similar to ProPhoto
Gamma close to sRGB g=2.40, slope=12.92 (close to "Melissa" used by Lightroom)
Similar to ProPhoto
Gamma BT709: g=2.22, slop=4.5
Similar to ProPhoto
Linear gamma g=1.0, slope=0
Wide gamut, larger than AdobeRGB but smaller than ProPhoto
Gamma BT709: g=2.22, slope=4.5

The recommended output profile when you're saving to an 8-bit format and/or publishing to the web is RT_sRGB. If no profile is selected, none will be embedded, which means that "sRGB" is implied, though it is safer to embed RT_sRGB in terms of getting your image displayed properly in various applications.

RT_sRGB is a higher quality version of the standard sRGB profile, which surprisingly is inconsistent between implementations. RT_sRGB was custom-made for RawTherapee by Jacques Desmis and has 4096 LUT points, as opposed to the lower quality 1024 point sRGB profiles. Applications that aren't color managed and won't take advantage of RT_sRGB will fall back on sRGB.

Wide-gamut output profiles such as RT_Large_gsRGB are generally used if you export to a 16-bit or higher bit-depth format for further editing in another application. If you will be sending your image for printing, a wide-gamut output profile is also recommended, since some printers may have wide gamuts (at least in certain colors).

You should have a wide-gamut monitor if you want to work with wide-gamut profiles, otherwise you're flying in the dark.