/* * * Create a left-to-right flip of the original image. Although we could * exchange pixel values in place, we take the easier approach of * creating a second image. */ // Can either load an image stored locally, as follows: // PImage slu = loadImage("campus4.jpg"); PImage slu = loadImage("http://business.slu.edu/uploads/2012/11/08/slu-homepage-campus4.jpg"); int w = slu.width; int h = slu.height; PImage reverse = createImage(w,h,RGB); for (int x=0; x < w; x++) { for (int y=0; y < h; y++) { reverse.set(x, y, slu.get(w-1-x,y)); } } // time to display it size(w,h); image(reverse,0,0);