rgroves – Project09 – Portrait

sketch

var Will;

function preload() {
	var URL = "https://i.imgur.com/sdnZ6UU.jpg"
	Will = loadImage(URL);
}

function setup() {
    createCanvas(360, 480);
    background(120, 212, 204);
    Will.loadPixels();
    frameRate(3000);
}

function draw() {
	var px = random(0, width);
    var py = random(0, height);
    var ix = floor(px);
    var iy = floor(py);
    var color = Will.get(ix, iy);
    stroke(color);
    if (dist(px, py, 190, 320) < 10) { //centered at nose
    	line(px + 15, py + 15, 190, 320);
    } else {
    	line(lerp(190, px, .9), lerp(320, py, .9), px, py);
    }
}

For this project I used a picture of my friend Will. Because it’s a funny picture, I wanted to create a funny way to generate it. I decided to use lines that radiate out from his nose, which looks really big at this angle. I changed the background color after I took this screenshot, but this is what it looks like after you let it run for a while. I like how not only do the lines point to his nose, but they get longer as they get father away. It gives the picture a cool exploding effect.

This is photograph I used.

 

Leave a Reply