i mentioned to merlucin that i had found a nice website awhile back with the
formulas for the photoshop blend modes. this is probably useful to others as well
so i'll post it here. www.pegtop.net/delphi/articles/blendmodes/. here's a summary so you don't have to navigate through all the links to collect em all.

multiply a * b
screen 1 - (1 - a) * (1 - b)
darken min(a, b)
lighten max(a, b)
difference abs(a - b)
negation 1 - abs(1 - a - b)
exclusion a + b - 2 * a * b
overlay a < .5 ? (2 * a * b) : (1 - 2 * (1 - a) * (1 - b))
hard light b < .5 ? (2 * a * b) : (1 - 2 * (1 - a) * (1 - b))
soft light b < .5 ? (2 * a * b + a * a * (1 - 2 * b)) : (sqrt(a) * (2 * b - 1) + (2 * a) * (1 - b))
dodge a / (1 - b)
burn 1 - (1 - a) / b

some modes use different formulas for light and dark colors and while this seems to work
pretty nicely in photoshop it can look ugly when things are moving around.
what i've found works well is to just compute both formulas and smoothly blend between them.