Open evanw opened 13 years ago
I found these on blending modes:
http://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/ http://en.wikipedia.org/wiki/Blend_modes http://stackoverflow.com/questions/5919663/how-does-photoshop-blend-two-images-together
The first one should be ported without problems i think.
All these composite operations are currently implemented in the 2D canvas. It might make more sense to use that instead of writing new code.
Might be of interesting, a few blend modes in WebGL, release under a modified MIT license:
I played with those glsl blend modes over the last couple of days when I didnt have net and wanted to look at this for procedural texture generation which really needs blend modes... https://gist.github.com/PAEz/c4a2f2f5f0f7f627eb1a http://jsbin.com/zizolabasice/1/edit ...Have fun with the jsbin test ;) I had to create a filter for every blend mode as trying to use an if/else block kept running out of memory. I really know jack all about gl so Im sure this could be better. One thing Id love some help with is did I get the alpha stuff right?....looks right ;) Now Im back on the net Ill be looking in to all this more.
Image composition effects would be awesome (effects combining multiple images). Ideas: