//Stefanie Suk
//15-104 D
//ssuk@andrew.cmu.edu
//Project 09 - Portrait
var self;
var size;
function preload() {
self = loadImage("https://i.imgur.com/oLizrAT.jpg");
} //load image
function setup() {
createCanvas(400, 600);
size = 6; //size of heart
noStroke();
background(20); //background color before image shows
imageMode(CENTER);
self.loadPixels(); //loading pixels
frameRate(30); //how fast heart covers canvas
}
function draw() {
var x = random(self.width);
var y = random(self.height);
var pixie = map(0, 0, width, size, size);
var p = self.get(x, y); //variables to create heart
fill(p);
ellipse(x+5, y-5, pixie, pixie);
ellipse(x, y, pixie, pixie);
ellipse(x-5, y-5, pixie, pixie);
ellipse(x-10, y-10, pixie, pixie);
ellipse(x+10, y-10, pixie, pixie);
ellipse(x+2.5, y-2.5, pixie, pixie);
ellipse(x-2.5, y-2.5, pixie, pixie);
ellipse(x+7.5, y-7.5, pixie, pixie);
ellipse(x-7.5, y-7.5, pixie, pixie);
ellipse(x+7.5, y-12.5, pixie, pixie);
ellipse(x-7.5, y-12.5, pixie, pixie);
ellipse(x+5, y-15, pixie, pixie);
ellipse(x-5, y-15, pixie, pixie);
ellipse(x+2.5, y-12.5, pixie, pixie);
ellipse(x-2.5, y-12.5, pixie, pixie);
ellipse(x, y-10, pixie, pixie); //coordinates to create heart
}
I created hearts to cover up the canvas and show an image of me in Lawrenceville. I tried to show how much fun I had in Lawrenceville by filling up the canvas with hearts, and the bright colors of the image fits well with the hearts as well.