---
title: "How Layer Masks Work: A Beginner's Guide"
description: "A mask is a coverage map beside the pixels: white reveals, black hides, grey blends. What the values mean, why the direction feels backwards, and what a mask cannot do."
canonical: "https://freeaigeneration.com/en/guides/how-layer-masks-work-a-beginners-guide/"
robots: "noindex"
lang: "en"
---

# How Layer Masks Work: A Beginner's Guide

A layer mask is a coverage map. It does not hold the picture; it holds one value per point saying how much of the layer should show at that point. White reveals, black hides, and every value in between blends the layer with whatever sits beneath it.

That is how layer masks work in a single sentence, and once it is clear, most of the confusion around them goes away — including the parts that look like faults: the behavior that feels inverted, the effect that vanishes on export, and the way a mask can be reworked months later without repainting a single pixel.

## The mask lives beside the pixels, not inside them

Here is the structural point. A destructive edit replaces pixel values. A mask leaves those values alone and adds a second array — the coverage values — which the editor consults when it composites the layer into the image.

That is why a masked layer can be revised later: the pixels were never changed, so the mask can be repainted, a hidden area restored, or the whole mask discarded to bring the layer back to full strength.

The same idea can be stored as a shape rather than a grid: a path describes the boundary, so its edge stays crisp at any magnification instead of being limited to the mask's pixel resolution.

## Reading the values

An 8-bit mask has 256 levels per point. 255 is fully visible, 0 is fully hidden, and the useful work happens in between.

A gradient from 0 to 255 gives a smooth transition in 256 steps, which is enough for most photographic blends. It is also why an aggressive mask on a subject against a busy background can show faint stepping: the transition lands on too few levels across too few pixels. Wider transitions and softer edges hide it better than a hard edge ever will.

The composite itself is a weighted average. A 50% mask over a red layer (255, 0, 0) with a blue layer (0, 0, 255) beneath composites to about (128, 0, 128) — half of each channel, a muted purple. At full coverage the result would be pure red; at zero, pure blue.

## Why the black-and-white direction feels backwards

A selection and a mask look like the same tool and work in opposite directions. In a selection, the selected area is the part you can affect: paint inside the marching ants and the paint lands there. In a mask, white is the part that shows: paint black into it and the layer disappears at that spot.

The inversion is the single most common source of the sinking feeling that a mask did nothing at all — the painter was working on the wrong side of the value scale. When a masked adjustment seems to have no effect, check whether the area you covered is black.

## What a mask does not do

It does not delete anything. Hidden pixels are still in the file, which is the point and also a surprise if the intent was to remove an object.

It does not crop. The canvas is unchanged; the covered area is simply not composited.

It does not survive flattening. Export to PNG or JPEG and the composite is what remains, so the mask is applied once and stored as blended values. A viewer that ignores mask data shows the layer in full, which is a good reason not to use masking as a way of hiding something inside a layered file.

## Where masks earn their keep

Two exposures of one scene, one masked to bring back the sky and the other the foreground. A subject lit differently from its background. A grade applied to the shadow side of a portrait and withheld from the highlights. Type that should look as if it passes behind an object in the photograph.

Every one of those is the same idea: keep the correction local, keep the original intact, keep the ability to change your mind.

Masks are part of the layer stack in the [Photo Editor](/en/tools/photo-editor/), which runs in a browser tab with no account and no autosave. The rest of the layered workflow — opening, stacking, saving a master, exporting a flat copy — is covered in [editing photos with layers and masks](/en/guides/how-to-edit-photos-online-with-layers-and-masks/). When two layers are meant to interact rather than sit side by side, [blend modes](/en/guides/photo-editing-blend-modes-explained/) decide how their values combine.
