PImage[] imgs = new PImage[4]; // loaded images PImage img; // current image int curImg = 0; // current image void setup() { size(400,600); for(int i = 0; i < imgs.length; i ++) imgs[i] = loadImage("img-"+(i+1)+".jpg"); img = imgs[curImg]; } PImage filterThreshold(PImage src) { PImage ret = new PImage(src.width,src.height); // make a new image float threshold = map(mouseX,0,width,32,200); // threshold for (int i=0; i threshold) ret.pixels[i] = color(255); else ret.pixels[i] = color(0); } ret.updatePixels(); return ret; } // Based on Greenberg 10-34 PImage filterContrast(PImage src) { PImage ret = new PImage(src.width,src.height); // make a new image float contrast = map(mouseX,0,width,0,.01); // factor by which to push toward either 0 or 255 for (int i=0; i