Photoshop blend modes, now in Processing!

edited December 2013 in GLSL / Shaders

Hello everyone,

A few days ago, a GLSL implementation of all 25 Photoshop blend modes was posted to

After a little tweaking, I got them all to work in Processing and coded a simple demo sketch (complete with comments).

To download the sketch click on this link .


Feel free to ask questions in the comments.


  • Excellent, thanks a lot!

    One quick note regarding the shader API: the type defines (PROCESSING_COLOR_SHADER, etc) are becoming optional in 2.1 and newer (you can think of those more like "hints"), I will update the tutorial as soon as possible to reflect these changes...

  • Oh, thanks for the heads up! Is there any parsing of the shader code to determine what uniforms to pass (like in the early betas) or are you passing all standard uniforms regardless of the type of geometry?

  • Processing will try to pass to the shader the data that is being used to render the current piece of geometry (for instance, if the scene has lights it will attempt to pass the light uniforms). By "try to pass" meaning that if the shader doesn't have the corresponding uniform variables, Processing will simply skip passing that data.

  • thanks for this script! i'm having problems using it with transparent .png files.. (the transparent area appears with a lot of artefacts and a "smear" effect, like pixels shifted through the whole area a leaving its traces). Is it a problem with the mode? is there a work-around? thanks again for the great work!

  • edited May 2015

    Yes, this is a known issue mentioned in the shadertoy comments.

    The author said:

    I've only been using these for combining textures to get more variation, so I didn't bother handling transparency. It should be easy enough to add if you need to do proper compositing.

    I didn't have time to get around it myself, but I might get back to it in the future (no promises though). Let me know if you figure it out.

Sign In or Register to comment.