xxxxxxxxxx
32
let img;
function setup() {
img = loadImage("conclusion.jpg");
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(4,0,255);
img.resize(windowWidth, windowHeight);
fill(255);
noStroke();
let tiles = mouseY/8;
let tileSize= width/tiles;
translate(tileSize/2, tileSize/2);
for (let x= 0; x < tiles; x++) {
for (let y = 0; y < tiles; y++) {
c=img.get(int(x*tileSize), int(y*tileSize));
let size = map(brightness(c), 0, 255, 30, 0);
ellipse (x*tileSize, y*tileSize, size, size);
}
}
}