PImage myImage; //define an image object myImage = loadImage("memorial.jpg"); //load it size(myImage.width,myImage.height); //size it to fit the window image(myImage, 0,0); //display the image int filter = 1; //choose a filter switch(filter) { case 1: filter(THRESHOLD, .6); //every pixel below .6 becomes black break; case 2: filter(GRAY); //all pixels get the average value of their rgb break; case 3: filter(INVERT); //all pixels get the opposite value of their rgb break; // (i.e. 255-r) case 4: filter(POSTERIZE, 2); //limits each channel of the image to 2 break; // colors case 5: filter(BLUR, 1); // executes a Guassian blur with radius 1 break; case 6: filter(BLUR, 6); // executes a Guassian blur with radius 6 break; } save("memorial_filter_"+filter+".jpg"); // save the image // as a numbered file