/* Thomas Keller, Flavio Schnelli */ //The Pixler Machine //Vorbefehl //Bild String ladeBild = "2.jpg"; PImage bild; //mögliche Variation float variation = 0; //Text PFont font; //Bilder, Hintergrund, Text laden void setup() { stroke(255); background(0); bild = loadImage(ladeBild); size(840, 485); image(bild, 0, 0); font = loadFont("arial2.vlw"); textFont(font); fill(255); text("The Pixler Machine", 650, 20); textSize(15); text("v = dunkle Pixel dominant", 650, 100); text("b = helle Pixel dominant", 650, 130); text("n = Pixel invertieren", 650, 160); text("m = Pause", 650, 190); textSize(10); text("Thomas Keller _ Flavio Schnelli", 690, 470); } //Farbpixel, Schalter float fr = 0; float fg = 0; float fb = 0; int schalter = 0; //Durchlauf der Pixelanalyse nach R,G,B der 3 Schalter und Veränderung void draw() { if (schalter == 1) { for ( int iy=0; iy<485 ; iy++ ) { for ( int ix=0; ix<640; ix++ ){ color f1 = get(ix,iy); color f2 = get(ix+round(random(-1,1)),iy+round(random(-1,1))); if (red(f1)red(f2)) { fr=red(f1+round(random(-variation,variation))); } else { fr=red(f2+round(random(-variation,variation))); } if (green(f1)>green(f2)) { fg=green(f1+round(random(-variation,variation))); } else { fg=green(f2+round(random(-variation,variation))); } if (blue(f1)>blue(f2)) { fb=blue(f1+round(random(-variation,variation))); } else { fb=blue(f2+round(random(-variation,variation))); } color c = color(fr, fg, fb); set(ix,iy,c); } } } if (schalter == 3) { for ( int iy=0; iy<485; iy++ ) { for ( int ix=0; ix<640; ix++ ){ color f1 = get(ix,iy); color f2 = get(ix+round(random(-1,1)),iy+round(random(-1,1))); if (red(f1)