/* Miranda Luong
Section E
mluong@andrew.cmu.edu
Project-09
*/
var underlyingImage;
function preload() {
var myImageURL = "https://i.imgur.com/Lq0vGxO.jpg";
underlyingImage = loadImage(myImageURL);
}
function setup() {
createCanvas(480, 480);
background(0);
underlyingImage.loadPixels();
frameRate(10000);
}
function draw() {
var px = random(width);
var py = random(height);
var ix = constrain(floor(px), 0, width-1);
var iy = constrain(floor(py), 0, height-1);
var theColorAtLocationXY = underlyingImage.get(ix, iy);
noStroke();
fill(theColorAtLocationXY);
rect(px, py, 10, 10);
}
This is Mimi. She is eating pizza. I thought it’d be a fun creating this build up to see a girl munching on pizza.