xxxxxxxxxx
26
let img;
function preload() {
img = loadImage('https://picsum.photos/400/400');
}
function setup() {
createCanvas(400, 400);
img.loadPixels();
frameRate(120);
const cx = img.width / 2;
const cy = img.height / 2;
for (let i = 0; i < 99999; i++) {
const x = random(img.width);
const y = random(img.height);
const c = img.get(x, y);
fill(c);
noStroke();
const distance = dist(x, y, cx, cy);
const radius = (distance / 25) + 3;
circle(x, y, radius);
}
}
function draw() {
}