darktable page lede image
darktable page lede image

3.4.3. Color group

Modules for working specifically on your image's color are found here in the color group.

3.4.3.1. Channel mixer

Overview
This module is a powerful tool to manage channels. It accepts red, green and blue channels as an input. As output it provides red, green, blue, gray, hue, saturation and lightness channels.
Usage

First select your output channel and then set the amount each input channel feeds into that output channel. Among its many uses, this module can be used to see the RGB channels individually: use the gray destination and put the value 1 on the input channel you want to see and 0 on the others.

Examples

For skin tones the blue channel tends to represent detail, with red tending to also have smoother tones than green. Therefore tonal rendering is controlled by how we blend of the three input channels.
Here a monochrome portrait is produced by simply selecting the grey channel as output. A smooth skin tone is achieved by reducing the blue channels input and also emphasizing the red channels input relative to green. An RGB mix of 0.9, 0.3, -0.3 was used together with an 0.1 EV exposure increase to lighten the image.
In this example an RGB mix of 0.4, 0.75, -0.15 uses more green than red, bringing back some features. We still reduce the blue channel in the mix to de-emphasize unwanted skin texture.

Table of mixing values for some b/w films

Classic black and white films have different characteristic color responses. Select gray as output mixing channel, and try out the values suggested below for your favorite film type.

Film Type Red Green Blue
AGFA 200X 0.18 0.41 0.41
Agfapan 25 0.25 0.39 0.36
Agfapan 100 0.21 0.40 0.39
Agfapan 400 0.20 0.41 0.39
Ilford Delta 100 0.21 0.42 0.37
Ilford Delta 400 0.22 0.42 0.36
Ilford Delta 3200 0.31 0.36 0.33
Ilford FP4 0.28 0.41 0.31
Ilford HP5 0.23 0.37 0.40
Ilford Pan F 0.33 0.36 0.31
Ilford SFX 0.36 0.31 0.33
Ilford XP2 Super 0.21 0.42 0.37
Kodak T-Max 100 0.24 0.37 0.39
Kodak T-Max 400 0.27 0.36 0.37
Kodak Tri-X 400 0.25 0.35 0.40
Normal Contrast 0.43 0.33 0.30
High Contrast 0.40 0.34 0.60
Generic B/W 0.24 0.68 0.08

3.4.3.2. Color balance

Overview
This module offers a versatile tool for adjusting an image's color balance. It can be used to revert parasite color casts or to enhance the visual atmosphere of a picture using color grading, a popular technique in the cinema industry.
Usage

The color balance allows you to shift colors selectively by luminance range: shadows, mid-tones, and highlights. It does so using two different methods:

  • lift, gamma, gain, the classic way, that allows a more separated control of shadows versus highlights,

  • slope, offset, power, the new standard defined by the American Society of Cinematographers Color Decision List (ASC CDL), more suited for scene-referred editing.

The master settings affect the whole image. They are not available in lift, gamma, gain (sRGB) mode. The slider ranges are limited to usual values ([50%; 150%] for saturations, [-50%; 50%] for contrast), but higher and lower values can be defined from keyboard inputs after a right-click on the corresponding slider.

Side note: although this module acts on RGB colors its location in pixelpipe puts it into the Lab color space. Accordingly the modules converts from Lab to RGB, does its color adjustments, and then converts back to Lab.

Mode

  • lift, gamma, gain (sRGB) is the legacy mode from darktable 2.4 and previous. In this mode, the color transformations are applied in sRGB color space encoded with the sRGB gamma (average gamma of 2.2).

  • lift, gamma, gain (ProPhotoRGB) is the same as the previous but works in ProPhoto RGB space, encoded linearly. In this mode, the RGB parameters are corrected in XYZ luminance (Y channel) internally so they affect only the color, and only the factors adjust the luminance.

  • slope, offset, power (ProPhotoRGB) applies the ASC CDL in ProPhoto RGB space, encoded linearly. Similarly to the previous mode, the RGB parameters are corrected in XYZ luminance internally. In this mode, the slope parameter acts as an exposure compensation, the offset acts as a black level correction, and the power acts as a gamma correction. All parameters will have some impact on the whole luminance range, but the slope will mostly affect the highlights, the offset will mostly affect the shadows, and the power will mostly affect the mid-tones.

For better efficiency, in slope, offset, power, it is recommended to set the slope first, then the offset, and finally the power, in this order. The name of the mode can be use as a mnemonic to remember the order.

In slope, offset, power mode, the shadows parameter has a far heavier effect than in lift, gamma, gain. Switching from the former to the latter, you should adapt the saturation in shadows, dividing by around 10.

Color control sliders

These parameters affect the user interface used for the shadows, mid-tones and highlights controls.

The RGBL controls allow direct access of the RGB parameters that will be sent to the algorithm and internally adjusted in XYZ luminance, depending on the mode used. They are the only ones stored in darktable's development history.

The HSL controls allow a more intuitive control, but are only an interface: the hues and saturations are computed dynamically from and to the RGB parameters and never stored. During the HSL to RGB conversion, the HSL lightness is always assumed to be 50%, so the RGB parameters are always balanced to avoid lightness changes. However, during the RGB to HSL conversion, the HSL lightness is not corrected.

As a consequence, editing in RGB, then in HSL, then again in RGB will not retain the original RGB parameters, but will normalize them so their HSL lightness is 50%. The difference is barely noticeable in most cases, especially using the modes that already correct the RGB parameters internally in XYZ luminance.

In both modes, additional factor sliders act on all RGB channels at once. Their effect is similar to the controls of the levels module (see Section 3.4.2.2, “Levels”) and affect only the luminance.

Input saturation

The input saturation is a saturation correction applied before the color balance. It can be used to dampen colors before adjusting the balance, to make difficult pictures easier to process. When you desaturate entirely the image, it creates a luminance-based monochrome picture that can be used as a luminance mask, to create color filters with the color balance settings, like split-toning or sepia effect (you might want to use blending modes then).

Output saturation

The output saturation is a saturation correction applied just after the color balance. It is useful once you have found a proper hue balance but find the effect too heavy, so you can adjust the global saturation at once instead of editing each channel saturation separately at the expense of possibly messing the colors.

Contrast and Contrast fulcrum

The contrast slider allows to increase the luminance separation. The fulcrum value defines the luminance value that will not be affected by the contrast correction, so the contrast will roll over the fulcrum. Luminance values above the fulcrum will be amplified almost linearly. Luminance values below the fulcrum value will be compressed with a power function (creating a toe). This correction comes after the output saturation and is applied on all RGB channels separately, so hues and saturations might not be preserved in case of dramatic settings (shadows might be resaturated, highlights might be desaturated, and some color shift is to be expected).

Shadows, Mid-tones, Highlights

Depending on the mode set, the shadows settings will control either the lift or the offset, the mid-tones ones will control either the gamma or the power, and the highlights ones will control either the gain or the slope. Parameters are transferred as is when you change the mode.

In RGBL mode, the RGB sliders range is limited to [-0.5; 0.5]. In HSL mode, the saturation sliders range is limited to [0%; 25%]. Values outside of these bounds can be defined from keyboard input after right-click on the slider.

Optimize luma

The color-picker close to the optimize luma label will select the whole image and optimize the factors for shadows, mid-tones and highlights so the average luminance of the picture is 50% Lab, the maximum is 100% and the minimum is 0%, at the output of this module. This is essentially an histogram normalization, similar to what the levels module can achieve. The optimizer is accurate only when used in slope, offset, power mode. It works only fairly in the other modes.

In case you want more control, you can define three control patches using the color-pickers in front of each factor slider, to sample luminance in selected areas. The shadows color-picker samples the minimum luminance, the mid-tones one samples the average, and the highlights one samples the maximum luminance. The most sensitive parameter is the mid-tones factor, since selecting a slightly different area can lead to dramatic parameter changes. Using the factors color-pickers alone, without triggering the luma optimization, will allow to perform adjustments without general optimization, but each parameter is always computed accounting from the two others. Once patches are selected, the label becomes optimize luma from patches. To reset one patch, you can just redo the selection. Patches are not saved in the parameters and are kept only during the current session.

It is important no note that the luminance adjustment performed targets only the output of the color balance module and does not account for other luminance adjustments performed in modules coming later in the pixelpipe (filmic, tone curve, color zones, levels, global tonemapping, etc.). Using the color balance to remap the luminance globally on the image is not recommended because it does not preserve the original colors, and modules such as tone curves or filmic are better suited for this purpose. Luminance adjustments in color balance are better suited for local correction, in combination with color adjustments, for color-grading with masks.

Neutralize colors

In an image where some areas are exposed to direct sunlight and some areas are exposed to reflected light (shadows), or when several artificial light sources are present simultaneously, shadows and highlights often have different color temperatures. These images are particularly difficult to correct since no general white balance will match all the colors at once. The color neutralization optimizer aims at helping you find the complementary color for shadows, midtones, and highlights so all the color casts are reverted, and the average color of the picture is a neutral grey.

Similarly to the luma optimization, the color-picker next to the neutralize colors label will trigger a general optimization over the whole picture. This works fairly in landscape photography, or any photography with a full spectrum of colors and luminances. For night and events photography, this will most likely fail and you will need to input manually the sampling areas with the color-pickers in front of each hue slider. For the highlights sample, use a color exposed to spotlights that should be neutral white or light grey. For the shadows sample, use a color exposed to ambient light that should be neutral black or dark grey. For the mid-tones sample, use a color exposed by both ambient and spot lights.

The success of the optimization depends on the quality of the samples. Not every set of samples will converge to a good solution, you need to ensure the color patches you choose are really neutral color in real life. In many cases the optimizer will output the correct hue but an excessive saturation that will need some extra tweaking. In some cases, no valid optimization will be delivered and you will need to reset the saturation parameters and start over, or simply stop after the patches selection. Notice that in the auto-optimization the maximum saturation is 25% which might not be enough in very few cases but will avoid inconsistent results in most.

If you select color patches from the hues color-pickers, without triggering the optimization, the software will only perform one round of optimization and stop so it allows you to control each luminance range separately and avoid divergence of the solution in corner cases. The hue and saturation corrections are computed accounting for the two other luminance ranges and the three factors, and will always output the complementary color of the selected area. If you want to reinforce the color of the area instead, you can then add 180° to the computed hue. Once patches are selected the label becomes neutralize colors from patches. To reset one patch you can just redo the selection. Patches are not saved in the parameters and are kept only during the current session. The parameters found by the automatic neutralization are accurate only in slope, offset, power mode, but can work to some extent in lift, gamma, gain too.

Examples

Several presets are provided in the module to help you understand how it can be used.

The teal/orange color-grading preset is a very popular look in cinema and a good showcase model. It is meant to be used with two instances and masks: the first instance will exclude skin tones and will shift neutral colors toward teal blue. The second will partially revert the first one and add more vibrance on skin tones only. Together they will help creating separation between subjects and backgrounds. The masking and blending parameters will need to be tweaked to suit every picture, though.

Other presets provide Kodak film emulations. In the same way you can recreate any film look you like with color balance.

3.4.3.3. Color look up table

Overview
This module implements a generic color look up table in Lab space. The input is a list of source and target points, the complete mapping will be interpolated using splines. The resulting luts are editable by hand and can be created using the darktable-chart utility to match given input (such as hald-cluts and RAW/JPEG with in-camera processing pairs). See Section 10.3, “Using darktable-chart for details.
Usage
color board

When you select the module in darkroom mode, it should look something like the image above (configurations with more than 24 patches are shown in a 7x7 grid instead). By default, it will load the 24 patches of a color checker classic and initialise the mapping to identity (no change to the image).

The grid shows a list of colored patches. The colors of the patches are the source points. The target color of the selected patch is shown as offsets controlled by sliders in the GUI under the grid of patches. An outline is drawn around patches that have been altered, i.e. the source and target colors differ.

The selected patch is marked with a white square, and its number is displayed in the combo box below. Select a patch by left clicking on it, or using the combo box, or using the color picker.

interaction

To modify the color mapping, you can change source as well as target colors.

The main use case is to change the target colors. You start with an appropriate palette of source colors (either from the presets menu or from a style you download). You can then change lightness (L), green-red (a), blue-yellow (b), or saturation (C) of the patches' target values via sliders.

To change the source color of a patch you select a new color from your image by using the color picker, and Shift+click on the patch you want to replace. You can switch between point and area sampling mode from within the global color picker panel (see Section 3.3.6, “Global color picker”).

To reset a patch, double-click it. Right-click a patch to delete it. Shift+click on empty space to add a new patch (with the currently picked color as source color).

3.4.3.4. Color contrast

Overview
The color contrast module provides simplified control for changing the contrast or separation of colors between either green/magenta or blue/yellow axis.
Usage

Higher values increase color contrast, lower values decrease it. The effect of this module's sliders are similar to applying a steepened or flattened a- or b-curve in module tone curve (see Section 3.4.2.3, “Tone curve”).

green vs. magenta

Changes color contrast for green versus magenta.

blue vs. yellow

Changes color contrast for blue versus yellow.

3.4.3.5. Color correction

Overview
This module can be used to modify the global saturation, give a tint to the image or to split tone it.
Usage
color board

For split toning move the white dot to the desired highlight tint and then select a tint for shadows with the dark spot. For a simple global tint set both spots to the same color.

saturation

Use the saturation slider to correct the global saturation.

3.4.3.6. Color zones

Overview
This module selectively modifies the colors in your image. It is highly versatile and allows every transformation possible in the LCh colorspace.
Usage

The horizontal axis represents the range of values you can work on. The vertical axis shows the modifications you can apply by designing a curve. For both horizontal and vertical axes you can work on lightness, saturation or hue.

You can click on any of the eight nodes on the curve and drag to adjust it vertically. A circle indicates how strong adjacent nodes will be affected. Use the scroll wheel of your mouse to change the circle diameter. You can also use the eight controlpoints (triangles which define the vertical value of the nodes) at the bottom to adjust the curve.

A color picker is activated by pressing and will show the picked values in the diagram. You can switch between point and area sampling mode from within the global color picker panel (see Section 3.3.6, “Global color picker”).

tabbed controls

You can define curves for each of the three channels lightness, saturation, and hue individually.

select by

Defines the horizontal axis, i.e. the range of values you work on. You can choose between lightness, saturation, and hue (default). Changing this parameter resets any defined curve to a straight horizontal line.

mix

Use this parameter to tune the strength of the overall effect.

3.4.3.7. Input color profile

Overview
This module can be used to override darktable's automatic allocation of input color profile if there is an alternative that more closely matches your original image's color space.
Usage

In this module you define the input color profile, i.e. how colors of your input image are to be interpreted. You also have an option to have colors confined to a certain gamut in order to mitigate some (infrequent) color artifacts.

profile

Choose the profile or color matrix to apply, darktable offers many widespread matrices along with an enhanced matrix for some camera models. The enhanced matrices were processed by the darktable team in order to provide a look closer to the manufacturer's.

You can also supply your own input ICC profiles and put them into $DARKTABLE/share/darktable/color/in or $HOME/.config/darktable/color/in. $DARKTABLE is used here to represent darktable's installation directory and $HOME your home directory. One common source of ICC profiles is the software that is shipped with your camera; it often contains profiles specific to your camera model. You may need to activate module unbreak input profile (see Section 3.4.3.11, “Unbreak input profile”) to use your extra profiles.

If your input image is a low dynamic range file like JPEG, or a raw in DNG format, it might already contain an embedded ICC profile which darktable will use as a default. You can always overrule darktable and select a different profile. Select embedded icc profile to restore the default.

gamut clipping

This combobox lets you activate a color clipping mechanism. In most cases you can leave it at its default off state. However, if your image shows some specific features like highly saturated blue light sources, gamut clipping might be useful to avoid black pixel artifacts. See Section 3.2.6.6, “Possible color artifacts” for more background information.

You can select from a list of RGB profiles. Input colors with a saturation that exceeds the permissible range of the selected profile get clipped to a maximum value. linear Rec2020 RGB and Adobe RGB (compatible) allow for a broader range of unclipped colors, while sRGB and linear Rec709 RGB produce a tighter clipping. You should select the profile that prevents artifacts while still maintaining highest color dynamics.

Examples

Close-up of a blue light source (LED) with gamut clipping off. The activated levels module produces a ring of black pixel artifacts.
The same image and processing with gamut clipping set to linear Rec2020 RGB .

3.4.3.8. 3D LUT

Overview

A 3D LUT is a tridimensional table which allows for the transforming any RGB value into another RGB value, normally used for film simulation and color grading.

The module accepts .cube and .png (haldclut) files. The 3D LUT data are not saved in database nor in the XMP file, only the 3D LUT file path inside the 3D LUT folder is saved (see below).

The module lut3d needs to find the 3D LUT file at the same place in your 3D LUT folder to calculate the output image. This means you have to backup properly your 3D LUT folder. Sharing an image with its XMP is useless if the recipient doesn't have the same 3D LUT file in his 3D LUT folder.

Usage
file selection

File selection is inactive as long as the 3D LUT folder (where you have stored your LUT files) is not defined in 3D LUT root folder under preferences/core options/miscellaneous.

application color space

A 3D LUT is relative to a specific color space. You have to select the one for which it has been built. Cube files are usually related to REC.709 while most of others are related to sRGB.

interpolation

The interpolation method defines how to calculate output colors when input colors are not exactly on a node of the RGB cube (described by the 3D LUT). There are three interpolation methods available: tetrahedral (the default one), trilinear and pyramid. Usually you won't see any difference between the interpolation methods except with small size LUTs.

3.4.3.9. Monochrome

Overview
This module is a quick way to convert an image into black and white and provides a variable color filter for that conversion.
Usage

A color picker is activated by pressing and will automatically set the position and size of the filter. You can switch between point and area sampling mode from within the global color picker panel (see Section 3.3.6, “Global color picker”).

The default central location of the filter has a neutral effect but dragging it to an alternate position applies a filter analogously to taking a b&w photograph through a conventional color filter.

As well as position you can change the filter size by scrolling with your mouse wheel. This makes the filter's range of hues more or less selective.

Tip: First reduce the filter size to concentrate its effect and move it across the hue pallet to find the best filter value for your desired image rendition. Then expand the filter to include more hues and thus more natural tonality.

Under certain conditions, especially highly saturated blue light sources in the frame, this module may produce black pixel artifacts. See the gamut clipping option (Section 3.4.3.7, “Input color profile”) on how to mitigate this issue.

3.4.3.10. Output color profile

Overview

This module manages the output profiles for export as well as the rendering intent to be used when mapping between the different color spaces.

darktable comes with pre-defined profiles sRGB, AdobeRGB, XYZ and linear RGB but you can provide additional profiles by placing these in $DARKTABLE/share/darktable/color/out and $HOME/.config/darktable/color/out. $DARKTABLE is used here to represent your chosen darktable installation directory and $HOME your home directory.

Usage

You can define the output color profile in two different places, either in this module, or in the export panel in lighttable mode (see Section 2.3.13, “Export selected”).

output intent

Sets the rendering intent for output/export. For more details see Section 3.2.6.3, “Rendering intent”).

Only rendering with LittleCMS2 gives you a choice of rendering intent. The option is hidden, if darktable's internal rendering routines are used. Rendering with LittleCMS2 is activated in the preferences dialog (see Section 8.2, “Core options”).

output profile

Sets the color profile for output/export, causing darktable to render colors with this profile. darktable embeds the profile data into the output file if supported by the file format – this allows other applications reading the file to correctly interpret its colors.

As not all applications, e.g. image viewers, are aware of color profiles, a general recommendation is to stick to sRGB as the default output profile. You should only deviate from sRGB if this is really required and if you know what you are doing.

3.4.3.11. Unbreak input profile

Overview
This module adds a correction curve to image data, which is required if you have selected certain input profiles in module input color profile.
Usage

If you decide in module input color profile to use an ICC profile from the camera manufacturer, a correction curve very frequently needs to be pre-applied to image data – or else the final output looks much too dark. This extra processing is not required if you use darktable's standard or enhanced color matrices. The correction curve is defined with a linear part extending from the shadows to some upper limit and a gamma curve covering mid-tones and highlights. For further reading please also have a look at darktable's neighbouring project UFRaw.

linear

Set the upper limit for the region counted as shadows and where no gamma correction is performed. Typically values between 0.0 and 0.1 are required by the profile.

gamma

Set the gamma value to compensate your input profile. Often the required value is 0.45 (the reciprocal of 2.2 gamma used by some manufacturer's profile).

3.4.3.12. Velvia

Overview
The velvia module enhances image saturation. Its effect is tailored to increase saturation less on lower saturated pixels than on highly saturated pixels.
Usage
strength

This slider controls the strength of the effect.

mid-tones bias

Velvia can reduce its effect for mid-tones to avoid unnatural skin tones. The mid-tones bias slider controls this selectivity; reducing its value reduces mid-tone protection and makes the overall velvia effect stronger.

3.4.3.13. Vibrance

Overview
Vibrance is a widely used term in image processing but the mechanism and end result differ from program to program. Vibrance in darktable saturates and brings down the lightness of the most saturated pixels to make the colors more vivid.
Usage

Vibrance only has one parameter which controls the amount applied.

vibrance

The amount of vibrance to apply to the image.