editing an image: scene-referred workflow

The scene-referred workflow places an emphasis on performing image processing in the linear scene-referred part of the pixelpipe. This helps to reduce artifacts and color shifts that can result from processing non-linear pixel values and, by decoupling the image processing from the characteristics of a specific display, it makes it easier to adapt your work in the future to new display media, such as high dynamic range displays.

This being the recommended way to process images in versions 3.0 and above, this section will provide a much more comprehensive overview than the next section on the display-referred workflow.

πŸ”—basic steps

Basic image processing in scene-referred workflow requires you, as a minimum, to consider the following steps in order to render a reasonable image on your display:

  1. Capture an image

    Use your camera to take a properly exposed image. Normally you can rely on the camera’s metering and automatic exposure features. However, for some scenes you may need to use the camera’s exposure compensation dial or manual settings to get an optimal exposure. In general, you want to make the exposure in camera as bright as possible without clipping the highlights. This is known as “exposing to the right” (ETTR), and it ensures you take best advantage of the sensor’s dynamic range. Many cameras have features like “zebras” or “blinkies” to warn you when you are in danger of clipping.

  2. Adjust mid-tones using the exposure module

    Use the exposure slider in the exposure module to adjust the mid-tones in the image to an appropriate brightness level. At this stage, don’t worry about highlights and shadows – these will be handled later.

    The exposure module is enabled by default, and will include an initial exposure boost of +0.5EV to mimic the standard processing of most in-camera JPEGs. The metering systems in cameras vary, and some camera models might need a slightly larger exposure boost (eg. +0.8EV ~ 1.5EV), in which case you can create an auto-apply preset as required. The exposure module will detect if the camera’s exposure compensation dial was used (see above remarks about ETTR), and will re-adjust the exposure accordingly.

    You can tweak the black level in the exposure module to supply more contrast, but you need to be very careful doing this as you can end up with negative RGB values, which can cause the filmic rgb module to malfunction.

  3. Adjust the white balance

    It is important that the white balance is set correctly to form a solid basis for subsequent processing. The camera will normally store the selected white balance setting inside the raw file’s metadata, and darktable will use this as a starting point. To get a more accurate white balance, you can either use the color picker to select a neutral gray tone in the image, or you can switch to a different white balance preset from your camera, where available. Fine adjustments to the global white balance are made using the temperature slider and, less often, the tint slider. Moving the temperature slider to the left makes the image cooler (more blue), and moving it to the right makes it warmer (more orange).

    The white balance module is only able to make global adjustments to the white balance of the image. The color balance module, among other things, gives you even more control in cases where a scene was illuminated by multiple light sources at different color temperatures.

  4. Adjust the white and black points using the filmic rgb module

    This module performs tone mapping compression from the high-dynamic-range of the captured image, to the lower dynamic range of the display medium. The mid-gray tone level has already been set (above) with the exposure module. Filmic will propose, on its scene tab, an appropriate white point and black point for the image – you may need to adjust these for a particular scene. On the look tab you can adjust the midtone contrast and saturation settings if required.

πŸ”—other recommended modules

In addition to the basic modules described above, you may want to consider using the following modules to make your image look even prettier. These modules are known to work well with the scene-referred workflow:

crop and rotate / perspective correction
Quite frequently you want to only show part of the captured scene in your image, e.g. to take away some disturbing feature close to the frame. In other cases, the horizon in the image may need levelling, or there may be perspective distortions. All of this can be corrected with full manual control in the crop and rotate module. For a fully automatic correction of perspective distortions you may alternatively visit the perspective correction module.
retouch / spot removal / hot pixels
Sometimes you will need to remove spots caused by sensor dirt. The new retouch and the older spot removal modules are at hand for this and can also correct other disturbing elements like skin blemishes. If your camera has stuck pixels or tends to produce hot pixels at high ISO values or longer exposure times, take a look at the hot pixels module for automatic correction.
color balance
This is a versatile module that can be used to further adjust the contrast and saturation of an image, and can also be used to perform color grading (e.g. emulate “orange and teal” grading used in hollywood films, remove redness in skin tones, adjust for uneven color balance in shadows/midtones/highlights, etc.). The color zones module can also be helpful in some cases where you are unable to achieve the desired effect using the color balance module.
tone equalizer
Use this module to perform “dodging and burning” operations and recover detail in the shadows and highlights. This module generates a mask to average out the luminance in different parts of the image, and the equalizer allows you to selectively increase and decrease luminance levels using that mask. It is recommended that you first check the mask is set up appropriately, then you can use the sliders or the spline curve to adjust the various brightness levels. You can also place the mouse cursor over different parts of the image to see the EV level of the mask at that point, and then use the mouse wheel to adjust the brightness of that EV level accordingly.
local contrast
This module can emphasise detail and improve clarity, and is a good way to improve the general sharpness of an image. It is recommended that you use this module in local laplacian mode.

A more versatile but also more complex technique is to use the contrast equalizer module, which is very useful for making adjustments where spatial dimension plays a role. It has a number of pre-defined presets that may be helpful as a starting point in understanding this module.

denoise (profiled)
The denoise (profiled) module is usually your best option for reducing noise in an image. This module offers an almost β€œsingle-click” solution to remove noise. From a user perspective the effect only depends on camera type and ISO value, both derived from Exif data. All other settings are taken from a database of noise profiles that the darktable team has collected – now covering well above 300 popular camera models. The simplest way to use this module is non-local means (auto) mode. The wavelet feature of this module is also quite effective against color noise. It is recommended that you use this module at 100% zoom so that you can accurately see the effects of your changes.

Other modules that allow for image denoising include raw denoise, surface blur, astrophoto denoise, and the contrast equalizer module, which is based on wavelets. If your camera is not yet supported by denoise (profiled), astrophoto denoise is probably the most convenient alternative, as it allows you to treat color and luminance noise separately.

haze removal
Does what is says on the tin – removes atmospheric haze.
color calibration
This module offers a range of presets for making black and white images emulating classic film. It can also be used to tweak your color profile matrices, for example, to deal with color gamut issues.
lens correction
If your camera/lens combination is supported, use this module to correct for standard lens distortions, where corrections have not already been performed in-camera. The crop and rotate or perspective correction modules can also be used to simulate the effects of a tilt-shift lens.

πŸ”—modules to be used with care

There are some modules for which there is not yet an alternative that is well-suited to the scene-referred workflow. If required, these modules should be used sparingly and with care.

Tends to darken colors. Consider using color zones with a saturation parametric mask to give more control.
color zones
Transitions may not be graceful. An alternative can be to use color balance with a parameteric mask.
This module can produce unnatural-looking results with too strong a fall-off. You may be better off using the exposure module with an elliptical mask with large transition area, and perhaps adding color balance with the same mask to reduce saturation at the edges.

Note: When using blend modes on any module, you should be aware that many of the blend modes are optimized for display-referred space and assume a mid-gray value of 50%. For the linear scene-referred space, stick with blend modes based on arithmetic operations (addition, multiplication, division, subtraction, average), on maximum/minimum comparisons (screen) or on channel separations (hue, color, chroma, etc.).

πŸ”—other artistic effects

There are also a number of artistic effect modules available in darktable. To name just a few:

  • Use the watermark module to add an individual watermark to your image.
  • Use the grain module to simulate the typical noise of classical analogue photos.
  • Use the color mapping module to transfer the look and feel of one color image onto another.
  • Use the lowlight vision module to simulate human vision making low light pictures look closer to reality.
  • Use the graduated density filter to add a neutral or colored gradient to your image for exposure and color correction.

Please see the processing module reference for a list of the available modules.

πŸ”—modules to avoid

There are a number of modules which are no longer recommended for use within a scene-referred workflow. This doesn’t mean they can’t be used, but they can produce undesirable effects when their sliders are pushed too far, and there are better alternatives. In each case, the preferred alternative module is listed along with a brief explanation.

local tone mapping (deprecated)
prefer tone equalizer

This module applies a bilateral blur over a non-linear (log) mapping that can provoke halos and fringing. This is common issue for modules performing blurs and occlusions that operate over a non-linear encoding.

global tonemap (deprecated)
prefer filmic rgb

This module tries to deal with HDR images using the Lab color space, which is not well suited for high dyanamic ranges. The filmic rgb module operates in a linear space and can easily scale over a wide range of input values from the scene and fit them into the narrower dynamic range demanded by display and printing devices.

shadows and highlights
prefer tone equalizer

This module works with blurs in Lab color space, resulting in problems including halos, high local contrast in highlights and hue shifts towards blue in the shadows.

prefer contrast equalizer or tone equalizer

Another module doing blurs in Lab space. Prefer the contrast equalizer for blurring, or the tone equalizer if local dynamic range compression is needed.

prefer contrast equalizer or local contrast

Uses a blur performed in Lab space, so has the same problems as with the lowpass module. Use contrast equalizer for fine sharpness, or local contrast for general sharpness.

prefer contrast equalizer or local contrast

The USM algorithm used in the sharpen module suffers from same issues as the highpass module, and can easily cause artifacts. Use the presets offered by the contrast equalizer for de-blurring, or local contrast for general sharpness.

prefer color calibration (or color balance)

The monochrome module can be quite fiddly to use. The color calibration presets better emulate what physically happens with film, or you can set the output saturation slider in the color balance module to 0% for a more perceptual approach.

fill light (deprecated)
prefer tone equalizer (or exposure)

Used to add light to a scene, this module again uses blurs in Lab space. The tone equalizer works in linear space, or you can also achieve a similar effect by using the exposure module with a drawn mask.

prefer tone equalizer (or exposure)

Again, this module uses blurs in Lab space. Either use the tone equalizer module or the exposure module with a parametric mask, both of which operate with linear encodings.

zone system (deprecated)
prefer tone equalizer (or exposure)

This module again operates in Lab space, and becomes problematic if you push it too far. It is better to use the tone equalizer or multiple instances of the exposure module with parametric masks to narrow down on a zone.

color correction
prefer color balance

Prefer the color balance module, which works in RGB color space and allows easy adjustment of the white balance in shadows (offset), midtones (power) and highlights (slope). Note the offset, power and slope that we normally use in linear spaces roughly correspond to the lift, gamma and gain parameters used in non-linear gamma-encoded spaces.

prefer color balance

The output saturation slider of the color balance module uses similar logic as the velvia module, but without the hue and brightness shifts, which can be difficult to manage.

levels/rgb levels
prefer color balance

These modules basically implement a subset of the functions of the color balance module, which pretty much makes them redundant.

tone curve/rgb curve
prefer color balance

These modules are normally used to adjust contrast. Their user interface assumes the mid-gray level is around 50%, but in linear scene-referred space mid-gray is much lower at around 18%. It is better to adjust the contrast in color balance module, where the mid-gray reference point can be set with the contrast fulcrum slider.

contrast brightness saturation
prefer color balance

This module works in Lab color space (with the limitations that implies) and basically duplicates functions already provided by color balance.