Yingying Yan-LookingOutwards-09

sketch

/*
Yingying Yan
Section E
yingyiny@andrew.cmu.edu
Project - 09
*/

var zoey; //a picture

function preload() {
	var zoeyPic = "https://i.imgur.com/QcSx6L4.jpg"
    zoey = loadImage(zoeyPic);
}

function setup() {
    createCanvas(480, 320);
    background(0);
    zoey.loadPixels(); //get pixels from the picture
    frameRate(30);
}

function draw() {
    var x = random(width); //x position of the storke
    var y = random(height); //y postotion of the stroke
    var px = constrain(floor(x), 0, width-1); //x position of each pixel
    var py = constrain(floor(y), 0, height-1); //y position of each pixel
    var theColorAtLocationXY = zoey.get(px, py); //get the color of each pixel
    stroke(theColorAtLocationXY); //draw out zoey with small stokes
    strokeWeight(random(1,5));
    line(x, y, x - random(0, 9), y - random(0, 9));
}

I regret using my little sister’s picture. She is so cute but I am not good enough to render her picture to something better. But that is ok because she will never see this. Overall I think this project is interesting. It is like making a filter for photoshop. I started the project by trying to do something fancy, but I failed. I will try to fix that after I turn this in.

add
final result

Leave a Reply