Layers and masks: how non-destructive editing really works
Layers are not stacked images — they are instructions evaluated bottom-up at render time. Once that clicks, masks, clipping and adjustment layers stop being mysterious.
On this page
Most people learn layers as “pictures stacked on top of each other”. It works until you hit a clipping mask, then the mental model collapses. The accurate model is simpler: a layer is a set of parameters, and the canvas is the result of evaluating them in order, every time something changes.
The evaluation order
At render time the compositor walks the stack from the bottom up. For each layer it takes the pixel buffer, applies the mask (greyscale, 0 means invisible), multiplies by opacity, applies the blend mode against everything already composited underneath, and writes the result into the accumulation buffer.
Then it moves up. That is the whole algorithm. Everything that feels like magic is a variation on where the pixel buffer comes from and how the mask is computed.
Masks are grayscale images
A layer mask is a separate image channel, one value per pixel, where white means “show this pixel fully” and black means “hide it”. Unlike a selection, a mask can hold every value in between — which is why masked edges can be soft.
Two consequences follow, and both are worth internalising:
- Painting the mask, not the image. When you “erase” with a mask, you are painting black into the mask. The pixels underneath are untouched. Flip the mask, invert it, paint white back in, and the original detail returns at full fidelity.
- Masks are resolution-independent of your tolerance. You can refine a mask edge with blur, curves or a brush long after the fact without degrading the image itself.
A selection, by contrast, is binary in practice: a marching-ants boundary that becomes a mask the moment you apply it. Get in the habit of converting selections to masks rather than deleting pixels.
Adjustment layers are parameters, not pixels
An adjustment layer does not store an image. It stores a type (curves, levels, hue/saturation, colour balance) plus its parameters, and it evaluates against everything below it in the stack — optionally limited by its own mask.
This is the second reason non-destructive editing scales: thirty adjustment layers can add a few kilobytes to a file, whereas thirty duplicated pixel layers add gigabytes. It also means an adjustment can be retuned next month without loss, because nothing was ever baked in.
Clipping masks, in one sentence
A clipping mask replaces “everything below me” with “the layer directly below me, using its alpha as my mask”.
That is all it is. A clipped adjustment layer now affects only that one layer instead of the whole stack; a clipped colour fill paints only inside the shape’s pixels. If clipped layers look wrong, check the layer directly beneath — it is almost always the alpha source.
Blend modes are per-channel arithmetic
Multiply, screen, overlay and the rest are formulas applied per channel, between the layer and the accumulated result beneath it. They are not “effects” — they are the arithmetic the accumulator uses, which is why the order of two layers changes the outcome and why a blend mode applied to a group recalculates the group as a single flattened input first.
A workflow that keeps the door open
The habits that keep a document editable are cheap to adopt:
- Duplicate for retouching, and keep the original hidden but present.
- Mask instead of erasing; use the brush, not the eraser.
- Use adjustment layers for tone and colour, with masks for where they apply.
- Group by job — background, subject, colour, type — and name the groups.
- Flatten only on export, never in the working file.
None of this requires a specific application. It requires that the application honestly implements masks and adjustment layers — which is exactly what to test before committing to a tool. The PhotoPSD editor keeps masks, adjustment layers and clipping live in the layer stack; if you want to see how a real PSD carries them, the format breakdown covers the layer records.
Skip the download and try it now
Open a layered PSD, edit it, export a PNG — nothing is uploaded.