Han Yu Project 09 Portrait

sketch

// Han Yu
// Section D
// hyu1@andrew.cmu.edu
// Project 09 Portrait

var poolpic; //image variable
var pattern=["♛","♨","☆","♞","✌︎","🀧"]; //stores patterns to be drawn later

function preload() {
    var myImageURL = "https://i.imgur.com/f4kVoqD.jpg";
    poolpic = loadImage(myImageURL);
}

function setup() {
    createCanvas(600,400);
    background(95,171,188);
    poolpic.loadPixels();    
}

function draw() {
    scale(0.333,0.333); //makes the original image smaller

    //location and color variable of each pattern
    var x = random(width*3);
    var y = random(height*3);
    var c = poolpic.get(x, y);
    var randomly = floor(random(0,5.9)); //pattern to be drawn
    var p = pattern[randomly];  //randmly picks an item from pattern

    noStroke();
    fill(c);
    textSize(random(30,80));
    text(p, x, y);
}


In this project I used a picture of my bf. I was inspired by cool symbols and characters used in other people’s projects so I decided to use an array of symbols that describes my bf in my project.

After running three minutes…
The original photo.

Leave a Reply