Februar 23, 2012
Bildfilter der Pixel durch Mausclick in Bewegung bringt.PImage img; Pixel[] pixel; void setup() { img = loadImage("hunde.jpg"); size(img.width, img.height); loadPicture(); noStroke(); } void loadPicture() { // new pixels pixel = new Pixel[width * height]; // load picture img.loadPixels(); // get pixels for (int x = 0; x < img.width; x++ ) { for (int y = 0; y < img.height; y++ ) { int loc = x + y * img.width; pixel[loc] = new Pixel(x,y,img.pixels[loc]); } } } void draw() { background(0); for (int i = 0; i 5) { fill(c1); } else { fill(c); } rect(x,y,1,1); } }