creating overlay FX with the blend() function
superGlow is here: /p5/superGlow/
As the reference for the blend() function is not yet posted to the Processing website, here’s an excerpt about the various blend modes:
blend()
Function to copy a single pixel or region of pixels from one image into another (or in itself again) with full alpha channel support and a choice of the following modes to blend the colours of source pixels (A) with the ones of pixels in the destination image (B):
BLEND - linear interpolation of colours: C = A*factor + B
ADD - additive blending with white clip: C = min(A*factor + B, 255)
SUBSTRACT - substractive blending with black clip: C = max(B - A*factor, 0)
DARKEST - only the darkest colour succeeds: C = min(A*factor, B)
LIGHTEST - only the lightest colour succeeds: C = max(A*factor, B)
REPLACE - destination colour equals colour of source pixel: C = A
All modes (excluding REPLACE) will use the alpha information (highest byte) of source image pixels as blending factor. See the reference for alpha() for more detail. The source and destination regions need not be of equal dimensions, the function will automatically resize source pixels to fit the specified target region.




