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 filterFlip(PImage src) { PImage ret = new PImage(src.width,src.height); // make a new image for (int y=0; y= 1) pset(ret,x,y,pget(src,x,y)); // do nothing outside else pset(ret,x,y,pget(src,lx+int((x-lx)*d),ly+int((y-ly)*d))); } } ret.updatePixels(); return ret; } PImage filterScramble(PImage src, float sx) { PImage ret = new PImage(src.width,src.height); // make a new image for (int y=0; y