/** * 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(1200, 800); noStroke(); background(255); smooth(); x=0; y=0; } void draw() { x+=1; if(x>=80) { x=0; y+=1; if(y>=60) y=0; }; // if(x>=a.width) { // x=0; // y+=1; // if(y>=a.height) y=0; // }; color pix = a.get(x, y); block.set((int)brightness(pix)); int m=20; // block.draw(x*m, y*m, round(m*1.25), round(m*1.25), 5, 5); fill(0, 64);//this.value*25.5); block.draw(x*m, y*m, m, m, 20, 20); }