/** * 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(); int startx, starty; void setup() { //a = loadImage("eames.jpg"); a = loadImage("heads.jpg"); //a = loadImage("six.jpg"); //a = loadImage("six_160_10levels.jpg"); //size(a.width*5, a.height*5); size(1600, 1200); noStroke(); background(255); smooth(); startx=0; starty=0; x=0; y=0; } void draw() { color pix = a.get(x*4+startx, y*4+starty); block.set((int)brightness(pix)); int m=10; fill(0, 64);//this.value*25.5); //block.draw(x*m, y*m, round(m*1.2), round(m*1.2), 8, 8); block.draw(x*m, y*m, m, m, 8, 8); x+=1; if(x>=160) { x=0; y+=1; if(y>=120) y=0; }; }