How to Invert a Mask to Darken a Background

Inverting a mask is a fundamental image-editing technique used to separate a subject from its surroundings, allowing you to edit the background independently. By selecting your subject, creating a layer mask, and inverting it, you tell the editing software to protect the subject while leaving the surrounding area open for adjustments. This guide outlines the exact steps to invert a mask and darken your background using standard tools found in programs like Adobe Photoshop, Lightroom, Affinity Photo, and GIMP.

Understanding Layer Masks

In image editing, layer masks use grayscale values to control transparency:

  • White reveals the adjustment or layer.
  • Black conceals (protects) the layer.
  • Gray creates partial transparency.

When you select a subject and apply an adjustment, the mask normally defaults to affecting only that subject (white inside the selection, black outside). Inverting the mask flips these values, turning the subject black (protected) and the background white (editable).


Step-by-Step Guide to Inverting a Mask

1. Select the Subject

Use an automated or manual selection tool to outline the main subject you want to keep intact:

  • Photoshop / Affinity: Use the Select Subject button, Object Selection Tool, or Quick Selection Tool.
  • Lightroom: Click Masking and choose Select Subject.
  • GIMP: Use the Fuzzy Select Tool or Paths Tool.

Ensure your selection closely matches the edges of your subject.

2. Apply an Adjustment Layer

With the selection active, create a darkening adjustment layer. The most effective options are:

  • Curves: Offers precise control over contrast and shadow depth.
  • Levels: Useful for quick midtone and black-point adjustments.
  • Exposure: Quickly decreases overall brightness.

When applied, the software automatically creates a mask based on your active selection.

3. Invert the Mask

If the adjustment immediately darkens your subject instead of the background, the mask needs to be inverted:

  • Keyboard Shortcut: Select the mask thumbnail in the Layers panel and press Ctrl + I (Windows) or Cmd + I (Mac).
  • Properties Panel (Photoshop): Click on the mask thumbnail, open the Properties panel, and click the Invert button.
  • Lightroom: Right-click the subject mask in the Masking panel and select Invert, or check the Invert box.

The subject is now represented as black on the mask thumbnail, shielding it from any changes, while the background becomes white.

4. Darken the Background

Now that the mask targets only the background, adjust your settings:

  • Drag the center of the Curves line downward to lower the midtones and darken the scene naturally.
  • If using Exposure, drag the exposure slider slightly to the left.
  • Lower the Highlights or Whites slider if the background contains bright distractions.

5. Refine the Edges

To avoid visible halos or harsh lines between the subject and the darkened background:

  • Double-click the mask to open mask properties and adjust the Feather slider slightly (usually between 1 to 3 pixels) to soften transitions.
  • Select a soft Brush Tool, set the color to black, and paint over any areas of the subject that accidentally received darkening. Paint with white to darken missed background spots.