§ ¶Expressions for Photoshop blending modes
Just a quickie this time.
A while ago, I went hunting around for the expressions needed to implement Photoshop's layer blending modes. The basic ones like Lighter Color and Screen are easy to find or discern, but some of the lighting modes are harder to do. The best reference I've found so far is from a PDF blend mode addendum on Adobe's site:
It doesn't cover some of the more obscure modes like Vivid Light, but it notably covers the complex Soft Light algorithm and the HSL modes.
I guess it's a nice example of what level of mathematical alchemy is used in image processing - all the variants and exceptions are here only to extend some function with another function in a smooth way.
The whole "D(cb)-cb" term can be approximated very accurately by an order 6 polynomial which sure can be calculated in integers but it's question whether iterating the square root wouldn't be faster. You probably won't need any more than 8 bits of it.
Kasuha - 13 07 11 - 20:56
You probably saw it during your search, but some more information, although not official, can be found here :
Many blend modes are implemented in GLSL, including Vivid Light I think - it may be helpful :)
rotoglup (link) - 13 07 11 - 22:38