// Based on Examples | Basic | Pointillism PImage[] imgs = new PImage[4]; // loaded images PImage img; // current image int curImg = 0; // current image int numLines=3; // how many lines per mouse press int sz=10; // size of lines int pt=100; // how many dits to add every frame void setup() { size(300,450); smooth(); noStroke(); background(0); for(int i = 0; i < imgs.length; i ++) imgs[i] = loadImage("img-"+(i+1)+".jpg"); img = imgs[curImg]; } void draw() { for(int i = 0; i < pt; i ++) { // pick a random position and size int x = int(random(img.width)); int y = int(random(img.height)); float s = random(2,10); // get the color from the image color pixel = img.get(x,y); // draw a little ellipse fill(pixel); ellipse(x,y,s,s); } } void keyPressed() { if(key == ' ') { curImg = (curImg+1)%imgs.length; img = imgs[curImg]; } } // START NO NOTES // code used to capture screenshots void keyReleased() { if(key == '`' && !online) save("sketch.png"); }