darktable user manual

raster masks

Table of Contents

The final output of a module’s mask (the combined effect of all of its elements, refinements and opacity) is a grayscale raster image representing the extent to which the module’s effect is applied to each pixel. This raster image is stored internally for active modules, and can be reused by other modules later in the pixelpipe as a raster mask element.

As with any element, if the opacity value for a pixel in a raster mask is zero, it does not select that pixel; if the opacity is 1.0 it fully selects it. A raster mask can be combined with other elements – including other raster masks – using groups & operators, and it can be inverted, refined and given its own opacity, like any other element. For example, you can intersect the mask of an earlier module with a luminance range, or subtract a drawn shape from it.

#adding a raster mask

Click the import import button in the toolbar and choose a module under add raster mask. The raster mask is added to the selected group. A raster mask is linked to its source, not copied: when the mask of the source module changes, the raster mask changes with it. Modules that come later in the pixelpipe are listed for reference, but cannot be chosen.

Raster masks are identified in the mask layout by the name of the module that produced them. The link link button on the row focuses that module, so that you can edit its mask. When edit on canvas is enabled, hovering over a raster mask’s row tints the area it covers on the image.

Some modules provide raster masks of their own, in addition to the mask defined in their mask panel – for example, the clipping mask of highlight reconstruction. Raster masks can also be imported from images generated by other applications – see the external raster masks module.


Note: Raster masks are generated as part of a module’s internal processing. Once a module’s processing is complete its mask then becomes available to subsequent modules in the pixelpipe.

This has two implications:

  1. Raster masks cannot be generated by disabled modules since they do not participate in pixelpipe processing. As soon as you disable a module, or switch off its mask, its raster mask is no longer available: elements that use it select nothing, and a warning sign is shown next to their name.

  2. Raster masks are passed up the pixelpipe after module processing – they can only be used by modules that come later in the pipe than the generating module.


#mask consumers

When one or more modules later in the pixelpipe use the mask of the focused module as a raster mask, a mask consumers section is shown at the bottom of its mask panel. It lists those modules: click one to focus it and show its mask panel.

The opacity of the whole mask (set with the whole mask selected) changes the raster mask passed on to these modules, whereas the blend opacity of the module does not.