If you are a Flash developer or designer you know that Flash blend modes exist but are far less rich than Photoshop blend modes. Thus, it’s been a while that I developed Pixel Bender kernels to mimic Photoshop blend modes in Flash.
My goal was, at one point, to release them as open source code but at that time I was working on some other projects so I put them aside and forgot about it…
Until the other day when, on Twitter, @nicoptereasked :
has anyone ever done a photoshop exact ‘Color’ blendmode in AS3 ? if so are you sharing the sources ? huge thanks in advance ^^
I answered to him with a link to my solution’s source code in pastebin and the excellent @quasimondo provided his own quickly hacked solution.
So @nicoptere tested both solutions but none of them were very satisfying and in particular did not exactly mimic Photoshop Color blend mode.
I was a bit surprised because I took my inspiration directly from Adobe. So I analyzed my source code and discovered a small bug that prevented the kernel to mimic Photoshop in low contrast images. I fixed it and decided to push the source code to my GitHub repo.
Finally @nicoptere seemed happy with the result and me, happy to have helped him.
Twitter is a great tool for information sharing and the way it has been used in this case is the way I love social network : people helping each other.
To conclude, the source code of the pixel bender Color blend mode as well as 21 “Photoshop like” other blend modes are available here : http://github.com/sroucheray/sroucheray-as3/tree/master/pixelbender/blend_mode/.
Note : for full information on antecedence, this work on pixel bender kernels to mimic Photoshop blend modes in Flash had already been done by others, in particular here by Shane McCartney : http://www.lostinactionscript.com/blog/index.php/2009/05/26/custom-blend-modes-for-flash-10/. The work I have done has not been inspired by those antecedent works because I have been aware of them afterwards. Note (bis), on this site, it is said that the Color blend mode is still in development while the source code is available here. The solution is less simple than mine though.