PImage img; PFont font; void setup() { // load image img = loadImage("kaefer.png"); // load font font = loadFont("HelveticaNeue-Light-12.vlw"); textFont(font); // set window size size(10*5+img.width*4, 10*3+img.height*2); // draw() wird nur einmal aufgerufen noLoop(); } void draw() { // display original image(img, 10, 10); // print descriptions fill(0); text("0. Original", 10, img.height+30); text("The Filters in order from left\nto right:", 10, img.height+50); text("1. Inverted", 10, img.height+90); text("2. Gray scaled\n (based on luminance)", 10, img.height+110); text("3. Blured", 10, img.height+142); text("4. Red channel in gray scale", 10, img.height+160); text("5. Green channel\n in gray scale", 10, img.height+180); text("6. Blue channel in gray scale", 10, img.height+215); // display inverted PImage pic1 = img.get(); pic1.filter(INVERT); image(pic1, 10*2+img.width, 10); // display gray scaled based on luminance PImage pic2 = img.get(); pic2.filter(GRAY); image(pic2, 10*3+img.width*2, 10); // display blured picture PImage pic3 = img.get();; pic3.filter(BLUR,3); image(pic3, 10*4+img.width*3, 10); // display red PImage pic5 = img.get(); image(pic5, 10*2+img.width, 10*2+img.height); for (int x = 10*2+img.width; x < 10*2+img.width+pic5.width; x = x + 1) { for (int y = 10*2+img.height; y < 10*2+img.height+pic5.height; y = y + 1) { color col = get(x, y); set(x,y,color(red(col))); } } // display green PImage pic6 = img.get(); image(pic6, 10*3+img.width*2, 10*2+img.height); for (int x = 10*3+img.width*2; x < 10*3+img.width*2+pic6.width; x = x + 1) { for (int y = 10*2+img.height; y < 10*2+img.height+pic6.height; y = y + 1) { color col = get(x, y); set(x,y,color(green(col))); } } // display blue PImage pic7 = img.get(); image(pic7, 10*4+img.width*3, 10*2+img.height); for (int x = 10*4+img.width*3; x < 10*4+img.width*3+pic7.width; x = x + 1) { for (int y = 10*2+img.height; y < 10*2+img.height+pic7.height; y = y + 1) { color col = get(x, y); set(x,y,color(blue(col))); } } }