Advertisement
xeromino

westworld

Mar 30th, 2015
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. PImage img;
  2. float theta;
  3. int frames=80;
  4.  
  5. void setup() {
  6.   img=loadImage("jolie.jpg");
  7.   size(img.width, img.height);
  8. }
  9.  
  10. void draw() {
  11.   image(img, 0, 0);
  12.   float v = map(sin(theta), -1, 1, 0, 10);
  13.   for (int x=0; x<width; x++) {
  14.     for (int y=0; y<height; y++) {
  15.       if (brightness(img.get(x, y))>40) {
  16.         color c = img.get(x, y);
  17.         for (int i=0; i<v; i++) {
  18.         set(x-i*5, y, c);
  19.         }
  20.       }
  21.     }
  22.   }
  23.   theta += TWO_PI/frames;
  24.   //if (frameCount<=frames) saveFrame("image-###.gif");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement