Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Layers & blend modes lab

See how layer blend modes, opacity and layer masks work: the maths for two colours, and two layers blended on a picture.

+=

The same two colours in every mode

How to use

  1. Two colours: pick a bottom and a top colour, a blend mode and an opacity. The table shows the maths channel by channel (0 = none, 1 = full) and the tiles show the pair in every mode.
  2. Layers on a picture: choose two built-in layers or load your own photos (they stay on your device). Change the mode and opacity and watch the result.
  3. Add a layer mask: a gradient, a soft circle, or paint your own by dragging on the picture. Where the mask is black the top layer is hidden; where it is white it shows fully.

Keyboard and touch

TabMove between colours, menus and boxes; the result updates as you change them
Drag on the picturePaint the layer mask (when Layer mask is set to paint it yourself)

Tips

  • Multiply never makes anything lighter and white has no effect: good for shadows and line art. Screen is its opposite: black has no effect.
  • Overlay and soft light add contrast: try them with the grey ramp on top to see that 50 % grey changes nothing.
  • Difference shows what changed between two nearly identical pictures: matching parts turn black.
  • Colour mode keeps the bottom layer's light and dark but takes the top layer's hue: the classic way to tint a black and white photo.

About this tool

The modes and their formulas follow the W3C Compositing and Blending Level 1 specification, the same definitions used by web browsers and close to those of photo and design programs (which sometimes differ in small ways, for example in soft light). Colours are worked from 0 to 1 in sRGB without gamma conversion, as the specification does. The top layer covers the bottom with coverage a = opacity × mask; the result is a × blend + (1 - a) × bottom. Hue, saturation, colour and luminosity use Lum = 0.3 R + 0.59 G + 0.11 B. Every pixel is computed by our own code, not by the browser's canvas modes. Photoshop and other names are trademarks of their owners; this lab is not affiliated with them.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product