xxxxxxxxxx
45
let sketches = [];
let aquarelles = [];
function preload() {
// preload() runs once
for (let i = 0; i < 9; i++) {
sketches.push(loadImage('sketches/0' + (i + 1) + '.jpg'));
}
for (let i = 0; i < 7; i++) {
aquarelles.push(loadImage('aquarelle/0' + (i + 1) + '.jpg'));
}
}
function setup() {
createCanvas(664, 442);
noLoop();
}
function draw() {
blendMode(BLEND);
background(255);
blendMode(MULTIPLY);
for (let i = 0; i < random(1,7); i++) {
let img = aquarelles[int(random(0,aquarelles.length))];
let h = img.height/3;
let w = img.width/3;
image(img, random(width-w), random(height-h), w, h);
}
for (let i = 0; i < random(1,9); i++) {
let img = sketches[int(random(0,sketches.length))];
let h = img.height/4;
let w = img.width/4;
image(img, random(width-w), random(height-h), w, h);
}
}
function mousePressed(){
redraw();
}