Layer mask

A layer mask is how you hide parts of a layer without deleting the pixels. The rule is simple: paint black to hide, paint white to reveal. The underlying pixels are untouched — the mask only controls which parts of the layer are visible.

Why masks instead of erasure

If you erase pixels to remove a background, you’ve permanently deleted that data. If you add a layer mask and paint it black where you want the background to disappear, those pixels are still there — toggle the mask off and they reappear. This is why serious compositing always uses masks: the destruction is reversible.

How layer masks work in practice

Imagine you have a portrait on a white studio background and you want to composite it onto a landscape. Without a mask:

  1. Select the background pixels
  2. Delete them → background is gone permanently
  3. The subject’s hair has jagged edges where the selection wasn’t perfect → you can’t fix it without starting over

With a layer mask:

  1. Select the background pixels → apply as a mask
  2. The background disappears, but the mask can be painted with a soft brush to refine hair edges
  3. Change your mind? Invert the mask (Ctrl+I) to restore the background
  4. The original pixels are untouched throughout

Luminosity masks

A luminosity mask selects pixels based on their brightness — highlight luminosity masks select the brightest areas; shadow luminosity masks select the darkest. Landscape photographers use these to blend a darker sky exposure with a brighter foreground exposure, creating a seamless HDR without the artificial look of automated HDR.

Photoshop, Affinity Photo, and Capture One all support luminosity masks. Lightroom does not — it’s one of the features that pushes serious landscape photographers toward Photoshop or Affinity for compositing work.

AI-generated masks

Both Photoshop and Affinity Photo now offer AI-assisted selection tools that automatically generate masks:

  • Photoshop Select Subject — identifies the primary subject (person, animal, object) and creates a selection ready to convert to a mask
  • Photoshop Select Sky — identifies the sky region specifically
  • Affinity Photo Quick Mask — similar one-click selection around primary subjects

These AI selections aren’t perfect — hair, transparent objects, and complex backgrounds still require manual refinement — but they eliminate 80% of the manual work on typical portraits.

Tools that support layer masks

  • Photoshop — the reference implementation; every mask type, luminosity masks, AI selection
  • Affinity Photo 2 — full equivalent; pixel masks, vector masks, luminosity masks
  • GIMP 3.0 — masks supported; interface differs from Photoshop
  • Lightroom — masks exist but in a different model (masking panel, not layer-based); you cannot create arbitrary painted masks the way Photoshop or Affinity allow

See also