/* * For amusement, we swap the color channels, replacing * red with green, green with blue, and blue with red. */ PImage slu; int w,h; void setup() { size(408,300); // take advantage of our knowledge of the size // Can either load an image stored locally, as follows: // slu = loadImage("campus4.jpg"); // Or can load an image from a URL as follows: slu = loadImage("http://business.slu.edu/uploads/2012/11/08/slu-homepage-campus4.jpg"); w = slu.width; h = slu.height; for (int x=0; x < w; x++) { for (int y=0; y < h; y++) { color c = slu.get(x,y); color replace = color(green(c), blue(c), red(c)); slu.set(x,y,replace); } } image(slu,0,0); }