xxxxxxxxxx
let img;
function preload() {
img = loadImage('fuschlsee.jpeg');
}
function setup() {
createCanvas(1600, 1000);
noStroke();
background(255);
// If you want to get faster access to the pixels, uncomment this and use the pixels[] array.
// img.loadPixels();
}
function draw() {
//draw 100 circles using colours drawn from the image (not shown)
for (let i = 0; i < 100; i++) {
let x = floor(random(img.width));
let y = floor(random(img.height));
let colorAtPixel = img.get(x, y);
fill(colorAtPixel);
circle(x, y, random(1, 10));
}
function mousePressed() {
// Save the current frame as an image
saveFrame("output/frame-####.png");
}
}