fractalkitty looking for math? fractalkitty.com

100 days of code

Pointillism_Day1

#random#image#animation#accumulates

dotIt

let cnt = 100;
function preload() {
  bg = loadImage('/assets/IMG_3913.jpeg');//load image
}
function setup() {
  cnv = createCanvas(bg.width/5, bg.height/5);//canvas creation
  noStroke();//no lines
}
function draw() {
 for(let i=0;i<20;i++){//each frameCount will draw 50 circles (change for speed)
   dotIt();
 }
}
function dotIt(){
 x = random(0,width);//random x in the canvas
 y = random(0,height);//random y in the canvas
 pix = bg.get(bg.width/(width/x), bg.height/(height/y));
 fill(pix);//set fill to pixel color from image
circle(x,y,int(random(1,3+bg.width/(frameCount))));//draw circles
}