transparency effects

Hello OFers,

Basically I am working on a project where I need to overlay an image I am loading on top of a video. The way I load and put it on top, it works okay, I can give it 50% transparency with no background. The problem is I need some blending effects here, like overlay or multiply just like in photoshop. Now I was wondering if openframeworks guys implemented something along those ways to achieve a similar effect.

I would appreciate any help

Yep you can… Since it’s rendered with OpenGL, you can use the functions from OpenGL to do it. It’s not as easy as in photoshop, but the trick is the function called glBlendFunc()… Take a look here: and on google…

also, if you poke in ofGraphics you can see that ofEnableAlphaBlending, is essentially


but your blend func can be any number of combinations. it can be tricky to find the right one at first, but most of the photoshop layerings can be done with the right combinations:…-nc.3G.html

the two parameter relate to what gets mutliplied by the src pixel and what gets multiplied by the detination pixel before they are added.

there are extensions and so on for more complicated blendings, but you can do quite alot with these…

take care

Here’s another link that could be useful:…-terials%29

look here:…-Frameworks
go down to where it says blending.

Its would be awesome if someone had some time to finish up/update this wiki page. It is very useful to people getting into openGL with oF.

[edit] never mind. I re-read your post and you are looking for blending effects. But I will keep this link up because it is not well documented (it is not up as a link in the main wiki page) and I think it might be useful to someone.

thanks for all the lovely links!