final version of path and mountains with targeted adjustments
original image of path and mountains

Darktable's powerful drawn masks and parametric masks let you quickly and easily make targeted edits to only part of an image. Let's learn how to use both types of masks and then make several example adjustments.

Drawn Masks

A drawn mask making a targeted adjustment to the path

As described in the manual, drawn masks allow you to draw a shape around an area of the image and only apply the effects of the module to the area. In the past, software might have required you be very precise when creating the mask to avoid affecting surrounding regions. However, with darktable's drawn masks, you can utilize the details threshold, fethering radius, blurring radius, mask opacity, and mask contrast sliders (more info) to make the mask fill the desired area with just a rough outline. This mask covers the walking path and allows us to make it lighter to draw more attention to it. Simply using the feathering radius slider allows a quickly-created drawn mask to fill in the entire area of the path:

adjusted path to draw attention to it
original version of the path

Note that you can also invert the polarity of a drawn mask to select everything except for the mask if masking the area you wish to exclude is the easier way to achieve the desired adjustment.

Parametric Masks

A parametric mask making a targeted adjustment to the sky

A parametric mask lets you quickly select part of an area based on its luminance, chromacity, or hue. For example, the sky is much brighter than the rest of the scene, so it's easy to make a parametric mask that selects only the sky. In this case, we want to add some color contrast to the scene by contrasting the sky color (a light yellow) with the mountains (blue). We also want to make this change to any reflective surfaces, like the path. See the before and after color wheels for a visualization of this change:

Before:

original color wheel before sky adjustments

After:

new color wheel with sky adjustments

This results in the following subtle change to the scene:

adjusted sky to increase color contrast
original version of the sky

Similar to drawn masks, parametric masks can be inverted which is useful for certain adjustments. For example, if you wanted to select everything except the sky, you could invert the slider in the above parametric mask.

Combining Masks

A combination of parametric mask and drawn mask to adjust only the mountains

Adjusting the color of the mountains is tricky - we can easily exclude the tree in the foreground with a parametric mask but then also need a drawn mask to only select blues in the mountains and not elsewhere in the image. Fortunately, combining drawn masks and parametric masks makes this a breeze and you can easily adjust the area you want, even behind a detailed foreground object like a tree. We actually use this same combination of mask on an instance of color balance rgb (to adjust the blue in the mountains) and again with contrast equalizer to adjust the contrast:

adjusted sky to increase color contrast
original version of the sky

Set Operators

A combination of parametric mask and drawn masks with set operators

Sometimes you need a more complex mask - in this case we want to select all greens in the bottom half of the image (below the mountains) but only the grass and not the trees. To do this, we use a parametric mask select only the greens (not shown on the hz tab but it looks similar to the h tab in the last mask) and then excluding the darkest luminosity on the Jz tab, which is where the trees are located. Moreover, the drawn masks covering the sky and path use the set operators adjustments in the mask manager module to make the mask the difference of the drawn masks, thus excluding the sky and the path. This adjustment is subtle, but boosts the contrast of the greens and adds yellow to the green highlights and we have our final image:

final version of the image with many adjustments and multiple masks
original version of the greens

Conclusion

While they may appear intimidating at first, masks in darktable are a powerful and fast way to isolate exactly the part of an image you want to adjust. Moreover, the mask controls allow you to often create the desired mask quickly, without a lot of detailed work to draw precisely the correct shape pixel-by-pixel. This combination of power and speed makes sepective edits in darktable indispesable.


Support Us and Access The XMP File

If you found this article helpful, please subscribe to our newsletter or support us on Patreon and get access to bonus features including the RAW file and XMP used in this article!

Questions? Comments?

Do you have questions or comments about this article? Please contact us via Mastodon or Email - we want to hear from you!