Processing's blend() and filter() apply compositing modes and pixel filters to images
blend(srcImg, x,y,w,h, dx,dy,dw,dh, mode) composites an image region onto the display window using one of many modes: BLEND, ADD, SUBTRACT, DARKEST, LIGHTEST, DIFFERENCE, MULTIPLY, SCREEN, OVERLAY, etc. ADD brightens by adding pixel values; DARKEST keeps whichever pixels are darker; DIFFERENCE highlights dissimilarity. The filter() method applies preset image effects: GRAY (grayscale), INVERT, THRESHOLD, BLUR, ERODE, DILATE. These operate on the entire display window or a specific PImage. Blend modes are the bridge between Processing’s real-time rendering and the compositing vocabulary used in image editors.
Examples
PImage img = loadImage(“photo.jpg”); blend(img, 0,0,100,100, 0,0,100,100, ADD); filter(INVERT);
Assessment
Describe the visual result of blending two images with DIFFERENCE mode; give a use case where MULTIPLY would be more appropriate than ADD.