darktable page lede image
darktable page lede image

3.2.6. Color management

darktable employs a fully color managed workflow:

  • Input color specifications are taken from embedded or user supplied ICC profiles or, in the case of raw files, from a library of camera specific color matrices.

  • darktable automatically reads the display profile of your monitor (if properly configured) for an accurate color rendition on screen. Multi-screen setups are fully supported as long as a system service such as colord is in place and properly set up to inform darktable about the correct monitor profile.

  • Output files can be encoded in one of darktable's built-in profiles, including sRGB, Adobe, ProPhoto, Rec. 2020, Rec. 709 and other standard RGB color spaces, or into a color space supplied by the user as an ICC profile.

3.2.6.1. Display profile

In order for darktable to accurately render colors on screen it needs to find the correct display profile of your monitor. In general this requires your monitor to be properly calibrated and profiled, and it needs the profile to be correctly installed on your system. darktable queries your X display server's xatom as well as the system service colord (if available) for the right profile. If needed you can enforce a specific method in the miscellaneous section of the preferences dialog (see Section 8.10, “Miscellaneous”).

To investigate your display profile configuration you can call the darktable-cmstest binary (Linux only) which prints out useful information like profile name per monitor and tells you if the system is correctly configured (see Section 1.1.6, “darktable-cmstest binary”).

In rare cases you may need to manually select the display profile. This is possible from the softproof and gamut check option dialogs in the darkroom view (see Section 3.3.11.5, “Soft proof” and Section 3.3.11.6, “Gamut check”), and the display profile dialog in the lighttable view (see Section 2.1, “Overview”).

3.2.6.2. Rendering method

darktable can render colors either with its internal algorithms or by using the external library LittleCMS2. darktable's internal method is by an order of magnitude faster than the external one. The external option gives you a choice of the rendering intent and might offer a slightly higher accuracy in some cases.

A configuration parameter always use LittleCMS 2 to apply output color profile in the processing section of the preferences dialog (see Section 8.6, “Processing”) defines which method is used. Note, however, that if the given ICC is LUT-based, or contains both a LUT and a matrix, darktable will use LittleCMS 2 to render the colors regardless of that configuration parameter's value.

3.2.6.3. Rendering intent

If rendering with LittleCMS2 is activated (see Section 3.2.6.2, “Rendering method”) you can define how out-of-gamut colors are handled when converting between color spaces. A selection box in the export panel (see Section 2.3.14, “Export selected”), the output color profile module (see Section 3.4.1.2, “Output color profile”), and the soft proof option (see Section 3.3.11.5, “Soft proof”) gives you a choice of the following rendering intents:

perceptual Suited to pictures as it maintains the relative position of colors. This is usually the best choice.
relative colorimetric Out-of-gamut colors are converted to colors having the same lightness, but different saturation. Other colors remain unmodified.
saturation Saturation is kept but lightness is slightly changed.
absolute colorimetric Keep the white point.

3.2.6.4. darktable's color spaces

darktable's input images are either RGB files (like JPEGs or TIFFs) or camera raws – both represent colors by a combination of red, green and blue. Most of the actual image processing takes place in a large RGB "working profile" space, with some (mostly older) modules internally working in the CIELAB color space. The final output of the image processing pipeline is in an RGB space shaped for either the monitor display or the output file.

This process implies that the pixelpipe has two fixed color conversion steps: input color profile and output color profile. In addition there is the demosaic step for raw images, where the colors of each pixel are reconstructed by interpolation.

Each module has a position in the pixelpipe which tells you which color space the module lives in:

up to demosaic   Image is in raw data format with only latent colors. Each pixel carries lightness and color information for only one base color. Please mind that some of the modules in this part can also act on non-raw input images in RGB format with full information on all three color channels.
between demosaic and input color profile   Image is in RGB format within the color space of the specific camera or input file.
between input color profile and output color profile   Image is in the space defined by the selected working profile (linear Rec2020 RGB by default). As darktable processes images in 4x32-bit floating point buffers, we can handle large working color spaces without risking banding or tonal breaks.
after output color profile   Image is in RGB format as defined by the selected display or output ICC profile.

3.2.6.5. Unbounded colors

Theoretically the individual components of color data are confined to certain minimum and maximum levels. As an example the intensity of an individual red, green or blue color channel in RGB can be anything in the range between 0% and 100% (or between 0.0 and 1.0). Likewise the L channel in Lab can be anything between 0 (pure black) and 100 (pure white).

In practice sometimes the image processing steps in darktable's modules can lead to values which lie outside of these confined ranges. In fact even the well established color matrices, which convert from RGB to Lab, may sometimes produce pixels with negative L values.

Pixels with these kind of values are said to have unbounded colors. One could clamp (i.e. confine) those values to the allowed range at every processing step. However, it has been found that it is much preferred and less prone to artifacts to not clamp in-between unbounded colors, but treat them just like any other color data.

In darktable there is no technical requirement for clamping; due to the fact that we are using floating point arithmetics for all processing steps, unbounded values can be passed along like any other value until the final color conversion module makes sure that they are transferred into the most reasonable color within the selected output color space. Therefore darktable avoids clamping as far as the underlying algorithms allow.

3.2.6.6. Possible color artifacts

That said there are some infrequent situations which still can lead to problematic results unless the user takes some action. Some modules in Lab color space, like levels and monochrome, need to rely on the fact that the L channels carries all lightness information and the a and b channels purely represent chroma and hue. Unbounded colors with negative L values are especially problematic to these modules and can lead to black pixel artifacts.

It has been found that highly saturated blue light sources in the image frame are likely candidates for pixels with negative L values. If you are engaged in stage photography you should pay close attention to such lights appearing in images.

In order to mitigate that issue the input color profile module (see Section 3.4.1.11, “Input color profile”) has a gamut clipping option. It is off by default but can be activated in case you observe artifacts. Depending on the settings, colors get confined to one of the offered RGB gamuts. In effect black pixel artifacts are prevented at the costs of losing some color dynamics. See Section 3.4.1.11, “Input color profile” for an example.