Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Roofing

By: caitlinorbanek on Dec 15th, 2011  |  syntax: None  |  size: 0.50 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }