Advertisement
xeromino

d3

Nov 6th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. PImage img;
  2. int turns = 50;
  3. float r;
  4.  
  5. void setup() {
  6.   size(800, 600);
  7.   background(255);
  8.   img = loadImage("pic2.JPG");
  9.   imageMode(CENTER);
  10.   img.filter(THRESHOLD);
  11.   img.filter(BLUR, 0.7);
  12.   img.loadPixels();
  13.   for (int x=0; x<img.width; x++) {
  14.     for (int y=0; y<img.height; y++) {
  15.       color c = img.get(x, y);
  16.       if (brightness(c)<200) {
  17.         img.pixels[y*img.width+x] = color(0);
  18.       } else {
  19.         img.pixels[y*img.width+x] = color(255);
  20.       }
  21.     }
  22.   }
  23.   img.updatePixels();
  24.   ///*
  25.   for (int i=0; i<turns; i++) {
  26.     pushMatrix();
  27.     translate(width/2, height/2);
  28.     rotate(r);
  29.     tint(255.0/turns*i, 100);
  30.     image(img, 0, 0);
  31.     popMatrix();
  32.     r += TWO_PI/turns;
  33.   }
  34. }
  35.  
  36. void draw() {
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement