glfx.js icon indicating copy to clipboard operation
glfx.js copied to clipboard

need image composition effects

Open evanw opened this issue 14 years ago • 4 comments

Image composition effects would be awesome (effects combining multiple images). Ideas:

  • different blending modes
  • alpha channel transfer
  • alpha channel recovery
  • unblending (blending equation in reverse)
  • mask generation with thresholding
  • image matting
  • pyramid blending

evanw avatar Aug 10 '11 06:08 evanw

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.

gdotdesign avatar Oct 09 '11 19:10 gdotdesign

All these composite operations are currently implemented in the 2D canvas. It might make more sense to use that instead of writing new code.

maz avatar Dec 16 '11 01:12 maz

Might be of interesting, a few blend modes in WebGL, release under a modified MIT license:

http://devmaster.net/posts/3040/shader-effects-blend-modes

mudcube avatar Jul 13 '13 09:07 mudcube

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.

PAEz avatar Aug 28 '14 13:08 PAEz