Advertisement
caitlinorbanek

Roofing

Dec 15th, 2011
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. PImage img;
  2.  
  3. int imgScale = 8;
  4.  
  5. int pointillize = 10;
  6.  
  7. void setup () {
  8. size(500, 500);
  9. img = loadImage("Roofing.jpg");
  10. background(255);
  11. smooth();
  12. }
  13.  
  14. void draw() {
  15. int x = int(random(img.width));
  16. int y = int(random(img.height));
  17. int loc = x + y*img.width;
  18.  
  19. loadPixels();
  20. float r = red(img.pixels[loc]);
  21. float g = green(img.pixels[loc]);
  22. float b = blue(img.pixels[loc]);
  23. fill(0);
  24. strokeWeight(1);
  25. fill(r,g,b,100);
  26. ellipse(x,y,pointillize,pointillize);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement