Advertisement
xeromino

caught

Mar 29th, 2015
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. PImage img;
  2.  
  3. void setup() {
  4.   //img=loadImage("https://s-media-cache-ak0.pinimg.com/736x/06/85/af/0685af6703ebb443176267bee9560237.jpg");
  5.   img=loadImage("https://s-media-cache-ak0.pinimg.com/736x/67/60/ae/6760aedd002069850dd0e51524b30748.jpg");
  6.   size(img.width, img.height);
  7.   image(img, 0, 0);
  8.   for (int i=0; i<2000; i++) {
  9.     int x =(int) random(width);
  10.     int y = (int) random(height);
  11.     color c = img.get(x, y);
  12.     if (brightness(c)>200) {
  13.       stroke(255, 100);
  14.       if (x<width*.7) {
  15.         line(x, y, 0, random(height));
  16.       } else {
  17.         line(x, y, width, random(100,height-100));
  18.       }
  19.     }
  20.   }
  21.   for (int x=0; x<width; x++) {
  22.     for (int y=0; y<height; y++) {
  23.       if (brightness(img.get(x, y))>50) {
  24.         //ellipse(x, y, 5, 5);
  25.         color c = img.get(x,y);
  26.         set(x,y,c);
  27.       }
  28.     }
  29.   }
  30. }
  31.  
  32. void draw() {
  33. }
  34.  
  35. void keyPressed() {
  36.   save(random(233)+".jpg");
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement