Most results from Google offer equations/formulas for blend modes that aren't reproducible in Photoshop, especially those that involve division such as Color Burn and Color Dodge. For example, RGB(255,0,0) with Color Burn over RGB (0,0,255) is supposed to yield RGB(0,0,0) according to this website, but in fact it yields RGB(0,0,255). The only place where I've found accurate formulas is this Gimp website, but it lacks a lot of blend modes.

Where can I find blend mode formulas that are accurate for Photoshop?


Adobe has published some of the blending modes as PDF specification. Check this : https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdf_reference_archive/blend_modes.pdf

All calculation formulas seem to be absent in Photoshop's user quides. I guess you need an in-group contact to get exact blending equations or you must reverse engineer Adobe's program code. That is probably forbidden in the usage license.

Nothing quarantees Photoshop uses PDF blending modes exactly. Color burn seems to test in the beginning if the backdrop has R,G or B =255 and in that case the result is 255. If the backdrop has 0...254, then the PDF calculation seems to be used in Photoshop, too.

BTW. This has been wondered a long time. You are not the first one. See this older case. I copied the guessed explanation from there after trying it:

Why is color burn not affecting a white channel?

In color dodge there seems to be in the beginning a test if there's R, G or B =0 in the backdrop. In that case the result is 0, otherwise It's calculated with PDF formula

| improve this answer | |
  • Even that one fails to accurately describe Color Burn and Color Dodge. I don't get it at all. – Vun-Hugh Vaw Jun 29 '19 at 21:34
  • @Vun-HughVaw dont remember where i saw it but burn formula is off by the 0 divide theres a fixed formula somewhere floating around – joojaa Jun 30 '19 at 19:58
  • @joojaa both of the problematic blendings have a division + an "if" rule to avoid division by zero. I presented a couple of "enhancements" i.e. new if-rules in Photoshop which seem to be inserted to define differently the result when the division alone would be 0/0 – user287001 Jun 30 '19 at 21:00
  • According to the Gimp page, the pure 0-1 algorithms don't always correspond 0-255 values which are neatly integers. So there are measures to prevent division by 0, for example by adding 1 to the denominator and using the factor 255+1=256 instead of 255. It's not as simple as clipping back to 0 if the denominator is 0 as those 0-1 algorithms suggest. – Vun-Hugh Vaw Jul 1 '19 at 7:39
  • So for the "Color Burn" mode for example, if foreground == 0 and background == 255 then result = 0 is wrong. It's actually if foreground == 0 and background == 255 then result = 255 - 256*(255 - 255)/(0 + 1) = 255 – Vun-Hugh Vaw Jul 1 '19 at 7:47

You can find some of them here (code by ben): https://www.shadertoy.com/view/XdS3RW

Keep in mind, however, that it's a very common problem that does not have a perfect known solution (at least to my knowledge). Most of the time you can approximate what PS does, but every now and then there's a subtle difference that no one just knows what's happening.

One of pain points that I noticed is that a lot of PS tools are not sRGB-correct even if you do enable sRGB in options. So if you're trying to reverse-engineer something in adobe's products (same thing for Illustrator), and something does not exactly match, try disabling sRGB correction for some intermediate values, which's incredibly dirty/incorrect, but it's the way it seems to work internally in PS.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.