xxxxxxxxxx
25
let slika;
function preload() {
slika = loadImage("ana1.png");
}
function setup() {
createCanvas(200, 200);
imageMode(CENTER);
background(200);
image(slika, width/2, height/2);
slika.loadPixels();
}
function draw() {
for(let i = 0; i < 50; i++) {
let x = random(0, width);
let y = random(0, height);
let pixels = slika.get(x, y);
fill(pixels, 128);
noStroke();
let r = map(mouseX, 0, width, 0, 20);
rect(x, y, r);
}
}