Willkommen auf unserem Seminar-Blog

Immer auf dem aktuellen Stand bleiben

Dieser Seminar-Blog befindet sich noch im Aufbau und wird in den kommenden Tagen entsprechend verfeinert.

Member Login

Lost your password?

Registration is closed

Sorry, you are not allowed to register by yourself on this site!

You must either be invited by one of our team member or request an invitation by email at viad.info {at} zhdk {dot} ch.

Processing – Image Filter

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);
  }
}