Show Menu
Cheatography

Photoshop Blending Modes: Math for GLSL Cheat Sheet by

This cheatsheet provides shader-friendly implementations of Photoshop's blending modes. These formulas are optimized for use in GLSL or HLSL shaders, making them suitable for real-time graphics applications.

Darken Group

Blend Mode
Commut­ativity
Formula
Darken
commut­ative
min(Ta­rget, Blend)
Multiply
commut­ative
Target * Blend
Color Burn
non-co­mmu­tative
1 - (1-Target) / Blend
Linear Burn
commut­ative
Target + Blend - 1

Lighten Group

Blend Mode
Commut­ativity
Formula
Lighten
commut­ative
max(Ta­rget, Blend)
Screen
commut­ative
1 - (1-Target) * (1-Blend)
Color Dodge
non-co­mmu­tative
Target / (1-Blend)
Linear Dodge
commut­ative
Target + Blend

Contrast Group

Blend Mode
Commut­ativity
Formula
Overlay
non-co­mmu­tative
(Blend > 0.5) ? (1 – (1-Target) / (2 * (Blend - 0.5)))
(Blend <= 0.5) ? (Target / (1 - 2 * Blend))
Soft Light
non-co­mmu­tative
(Blend > 0.5) ? (1 - (1 - Target) * (1 - (Blend - 0.5)))
(Blend <= 0.5) ? (Target * (Blend + 0.5))
Hard Light
non-co­mmu­tative
(Blend > 0.5) ? (1 - (1 - Target) * (1 - 2 * (Blend - 0.5)))
(Blend <= 0.5) ? (Target * (2 * Blend))
Vivid Light
non-co­mmu­tative
(Blend > 0.5) ? (1 - (1 - Target) / (2 * (Blend - 0.5)))
(Blend <= 0.5) ? (Target / (1 - 2 * Blend))
Linear Light
non-co­mmu­tative
(Blend > 0.5) ? (Target + 2 * (Blend - 0.5))
(Blend <= 0.5) ? (Target + 2 * Blend - 1)
Pin Light
non-co­mmu­tative
(Blend > 0.5) ? (max(T­arget, 2 * (Blend - 0.5)))
(Blend <= 0.5) ? (min(T­arget, 2 * Blend))

Inversion Group

Blend Mode
Commut­ativity
Formula
Difference
commut­ative
Target - Blend
Exclusion
commut­ative
0.5 - 2 * (Targe­t-0.5) * (Blend­-0.5)

Additional Inform­ation

Overlay: A combin­ation of multiply and screen. Also the same as Hard Light commuted.
Soft Light: A combin­ation of multiply and screen (The formula is only approx­imate).
Hard Light: A combin­ation of multiply and screen. Also the same as Overlay commuted.
Vivid Light: A combin­ation of color burn and color dodge.
Linear Light: A combin­ation of linear burn and linear dodge.
Pin Light: A combin­ation of darken and lighten.
               
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Discrete Math Cheat Sheet
          DIP Exam 2 Cheat Sheet
          Master Measures & Weights with this Cheat Sheet Cheat Sheet