/** * Drill Block by Robert Twomey * built from * Pointillism by Daniel Shiffman. * * Mouse horizontal location controls size of dots. * Creates a simple pointillist effect using ellipses colored * according to pixels in an image. */ PImage a; int x, y; DrillBlock block = new DrillBlock(); void setup() { //a = loadImage("eames.jpg"); a = loadImage("six.jpg"); //a = loadImage("six_160_10levels.jpg"); //size(a.width*5, a.height*5); size(1280, 960); noStroke(); background(255); smooth(); x=0; y=0; drawnext=false; } void keyPressed() { drawnext = true; } void draw() { color pix = a.get(x, y); block.set((int)brightness(pix)); int m=2; fill(brightness(pix), 194); block.draw(x*m, y*m, m, m, 6); x+=2; if(x>=640) { x=0; y+=2; if(y>=480) y=0; }; }