Advertisement
xeromino

boogie

Aug 2nd, 2014
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. PImage img;
  2. int f, step = 5;
  3.  
  4. void setup() {
  5.   img = loadImage("tmp-0.gif");
  6.   size(img.width, img.height);
  7.   background(0);
  8.   noStroke();
  9. }
  10.  
  11. void draw() {
  12.   convPic();
  13.   if (frameCount==171) noLoop();
  14. }
  15.  
  16. void convPic() {
  17.   background(255);
  18.   img = loadImage("tmp-"+(frameCount-1)+".gif");
  19.   for (int x=0; x<width; x += step) {
  20.     for (int y=0; y<height; y+= step) {
  21.       color col = img.get(x, y);
  22.       f= brightness(col)>150?255:0;
  23.       fill(f);
  24.       ellipse(x, y, step, step);
  25.     }
  26.   }
  27.   saveFrame("image-###.gif");
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement