OF Blending

In processing you have a function called blend(…).

basically you can blend pixels with these effects:

BLEND, ADD, SUBTRACT, LIGHTEST, DARKEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN

Looking at the processing source they are actually doing a loop through all the pixels and the applying the transformation.

I was just talking to memo and I think that this could be done with a shader. I’m posting this to see if anyone has gone down this road. It would be a great addon to ofImage of just any texture in OF.

here is some info about the processing PImage class

http://dev.processing.org/source/index.-…-iew=markup

T

i remember talking about doing something similar while preparing 006 but using glBlendFunc and glBlendEquation, then we decided to freeze the release and this didn’t went in 006. Don’t know if all of them can be done, but surely most of them don’t require a shader?

hi,

maybe this could help :

http://blog.mouaif.org/

in short, Photoshop post-processing effects and Hue/Saturation/Luminance conversion, desaturation, contrast, all in one glsl shader. :slight_smile:

tanks to this guy

Blending modes:

* Normal
* Lighten
* Darken
* Multiply
* Average
* Add
* Substract
* Difference
* Negation
* Exclusion
* Screen
* Overlay
* SoftLight
* HardLight
* ColorDodge
* ColorBurn
* LinearDodge
* LinearBurn
* LinearLight
* VividLight
* PinLight
* HardMix
* Reflect
* Glow
* Phoenix
* Hue
* Saturation
* Color
* Luminosity

Functions:

* Desaturation
* RGBToHSL (RGB to Hue/Saturation/Luminance)
* HSLToRGB (Hue/Saturation/Luminance to RGB)
* Contrast

glsl shader source code availaible here :

http://www.box.net/shared/hijgkl6tt9

hope it help.

wow, that is an amazing resource!! thanks!

Hi,

I’m new to openFrameworks but getting into it pretty fast I think :slight_smile:

I found the ofShader example and a few other posts about this topic, but in this examples there are always .vert and .frag files in use. This Photoshop-Shaders are a glsl file. Can anybody post a quick example how to use this or explain the differences to me?

Thanks!