xxxxxxxxxx
37
let io, colour;
let spacer = 50;
function preload() {
io = loadImage("/io.png");
}
function setup() {
frameRate(12);
noStroke();
createCanvas(io.width, io.height);
io.loadPixels();
}
function draw() {
io.loadPixels();
for (let i = 0; i < io.width; i += spacer) {
for (let j = 0; j < io.height; j += spacer) {
let c = io.get(i, j);
strokeWeight(1);
if (random() >= 0.5) {
stroke(c);
fill(c);
} else {
stroke(0);
fill(0);
}
rect(i, j, spacer);
}
}
if (spacer > 1) {
spacer-=0.2;
} else {
noLoop();
}
}