paperlined.org
apps > photoshop
document updated 16 years ago, on Aug 21, 2007
Layer math

Layer math in Photoshop & Co

The following are displayed in greyscale mode (otherwise, the operator is applied separately to each color channel). X and y values are considered to range from 0.0 (black) to 1.0 (white). The output of each function is clipped to this range (eg. if they fall below 0.0, they're set to black, and if they fall above 1.0, they're set to white).

While it's useful to visualize these as XY graphs, don't forget that every blend looks at color only, never at position.

Lower layer ("y") Upper layer ("x")
Blending Mode Operator Equation
Opacity Average a×x + (1-a)×y
Darken Minimum min(x,y)
Lighten Maximum max(x,y)
Pin Light max(min(2x, y), 2x-1)   (eg. Darken smooshed into the left half, Lighten smooshed into the right half)
Multiply Multiplication x × y
Screen Negative multiplication 1 - (1-x)×(1-y)
Linear DodgeAddition x + y
Linear Light 2x + y - 1
Difference Subtraction abs(x-y)
Linear Burn Negative subtraction
(in the range of 1.0 to 2.0)
x - (1-y)
Exclusion x+y - 2×x×y
Overlay
if y≤0.5: 2×x×y (eg. Multiply)
if y>0.5: 1 - 2(1-x)×(1-y) (eg. Screen)
Hard Light Overlay, swapped
if x≤0.5: 2×x×y (eg. Multiply)
if x>0.5: 1 - 2(1-x)×(1-y) (eg. Screen)
Color Burn Division1 - (1-y)/x
Color Dodge Divisiony/(1-x)
Vivid Light
if x≤0.5: 1 - (1-y)/2x (eg. Color Burn, smooshed into the left half)
if x>0.5: y/(2×(1-x)) (eg. Color Dodge, smooshed into the right half)
Soft Light
if x≤0.5: (2x-1)×(y - y2) + y
if x>0.5: (2x-1)×(√y - y) + y
Hard Mix
if x+y<1: 0
if x+y>1: 1

Similar pages