Photography and Imagery · Step 5 · 6 min read
Blend modes and the maths behind them
Multiply, screen, overlay and the rest are not magic presets: each is a short formula applied to every pixel. What the main modes do, the maths in plain numbers, why mid grey disappears in overlay, and how the same modes work in Figma, Photoshop and CSS.
A blend mode is a rule for mixing two pixels, and once you know the rule you stop guessing. Most designers try modes one by one until something looks right. That works, but it's slow, and you can't explain the choice to anyone. Each mode is a small formula, the same in Figma, Photoshop and the browser. Learn five and you'll know what the rest do.
What you'll be able to do after reading:
- Predict what multiply, screen, overlay, soft light and difference will do
- Do the maths for one pixel, in plain numbers
- Explain why some layers disappear in some modes
- Use blend modes in Figma and CSS, and keep them contained
1. One layer, eight modes
Normal (60%)The layer, see-through
MultiplyCan only darken
ScreenCan only lighten
Soft lightGentler contrast
DifferenceSubtracts: strange colours
ColorThe layer's colour, the photo's light
LuminosityThe photo's colour, the layer's lightmix-blend-mode.Photo: Danielle MacInnes, Wikimedia Commons (from Unsplash), CC0.Every tile is the same photo under the same red-to-blue gradient. Only the mode changes. The figure is live CSS: one mix-blend-mode per tile (MDN, mix-blend-mode).
2. The maths, in plain numbers
Think of every colour channel as a number from 0 (black) to 1 (white). The backdrop is what's underneath, the photo; the source is the layer on top. The W3C spec defines each mode as a formula of the two (W3C, Compositing and Blending Level 1). Take one pixel: photo 0.8, layer 0.5.
| Mode | Formula | Result |
|---|---|---|
| Multiply | photo × layer | 0.8 × 0.5 = 0.4, darker |
| Screen | photo + layer − photo × layer | 0.8 + 0.5 − 0.4 = 0.9, lighter |
| Darken | the smaller of the two | 0.5 |
| Lighten | the larger of the two | 0.8 |
| Difference | the gap between them | 0.8 − 0.5 = 0.3 |
Two things fall out of the maths, and they're worth remembering:
- Multiply can only darken, screen can only lighten. Multiplying by a number below 1 makes it smaller; white (1) changes nothing in multiply, and black (0) changes nothing in screen. That's why multiply is used for shadows and for putting a scanned drawing on paper over a photo: the white paper disappears.
- That's how the duotone in the last lesson works. Multiply the grey photo over the light colour: the whites become the light colour. Then lighten with the dark colour: nothing gets darker than it, so the blacks become the dark colour.
3. Overlay and soft light: contrast modes
Overlay multiplies where the photo is dark and screens where it's light, so darks get darker and lights get lighter: more contrast, coloured by the layer. Soft light does the same, gentler. In the spec, overlay is hard light with the two layers swapped (W3C, overlay).
Try the maths with a layer of mid grey, 0.5, over our 0.8 pixel. In overlay, the photo is light, so the layer is screened with twice the photo minus one, 0.6: 0.5 + 0.6 − 0.5 × 0.6 = 0.8. Nothing changes. In soft light the result is also 0.8.
So mid grey is invisible in overlay and soft light. That's why retouchers paint light and shadow on a grey layer set to overlay, and why grain is usually laid over in overlay: the grey of the noise vanishes, and only its lighter and darker specks show. The next lesson uses exactly that.
4. Color and luminosity: splitting colour from light
The last group doesn't mix numbers channel by channel. It takes parts of one colour and parts of the other:
- Color keeps the photo's light and takes the layer's hue and saturation: a way to tint a photo while keeping its detail.
- Luminosity keeps the photo's colour and takes the layer's light.
- Hue and saturation take just that one part.
5. The same modes everywhere
- Figma offers the same families of modes on layers, fills and effects. Groups and frames have Pass through: their layers blend with everything underneath. Set the group to Normal and its blends stay inside it (Figma Help, blend modes).
- Photoshop has the same modes and a few more of its own, with plain descriptions of each (Adobe, blending modes).
- CSS has
mix-blend-modefor an element over what's behind it, andbackground-blend-modefor background layers of one element.isolation: isolateis the CSS version of Figma's Normal group: the blend stays inside (MDN, isolation).
.photo { position: relative; isolation: isolate; } /* keep the blend inside */
.photo::after { content: ""; position: absolute; inset: 0;
background: linear-gradient(135deg, #e5484d, #3e63dd);
mix-blend-mode: soft-light; }
Forget isolation and a blended layer mixes with the page behind the photo too, which in dark mode can look completely different.
6. Common mistakes
- Trying modes at random and keeping whichever looks least wrong.
- Blending without isolation, so the result changes with the page background or the theme.
- Using multiply on a dark photo and wondering why it went black.
- Text set in a blend mode: it changes colour across the image and its contrast becomes unpredictable.
7. Vocabulary
| Term | Meaning |
|---|---|
| Backdrop | What's underneath: the photo |
| Source | The layer on top, being blended |
| Blend mode | The formula that mixes source and backdrop for each pixel |
| Isolation | Keeping a group's blends inside the group |
| Pass through | Figma's group setting that lets blends reach everything below |
8. Try it (no tools needed)
- Take a pixel of 0.2, a dark one, and a layer of 0.6.
- Work out multiply, screen and difference by hand.
- Before you calculate, guess which will be darkest. Then check.
Reflection questions: Which mode would you pick to darken a photo's edges, and which to make it glow? Could you now say why, to a developer?
9. If you already practise
- Name the mode in the design file and the spec: "gradient in soft light, 60%", so the developer doesn't have to guess.
- Always set
isolation: isolateon the container of a blended layer, and test both themes. - Keep text out of blend modes; put it above, in normal mode, and check its contrast.
Checklist
Learn more
- W3C, Compositing and Blending Level 1: every formula, in the spec
- MDN: mix-blend-mode · background-blend-mode · isolation
- Figma Help, blend modes · Adobe, Photoshop blending modes
Books, courses and videos to go deeper
Book links go to Amazon. As an Amazon Associate I earn from qualifying purchases, at no extra cost to you.
Related
Grade, black and white and duotone · Texture, grain and noise · Masks, clip paths and scrims