Joseph Zhang – Project 09 – Computational Portait

sketch

 // Joseph Zhang
 // Haozhez@andrew.cmu.edu
 // Section E
 // Project 09: Portrait

 var underlyingImage;
 var words = ['joseph', 'designer', 'student', 'cmu', 'loves 104']
 function preload() {
     var myImageURL = "https://i.imgur.com/LTgLTOy.jpg";
     underlyingImage = loadImage(myImageURL);
 }
 
 function setup() {
     createCanvas(500, 500);
     background(0);
     underlyingImage.loadPixels();
     frameRate(100);
 }
 
 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);
    //randomizes text size
    textSize(random(6));
    text(random(words), px, py);
    
    //draws text at mouseX and mouseY
    var theColorAtTheMouse = underlyingImage.get(mouseX, mouseY);
    fill(theColorAtTheMouse);
    text(random(words), mouseX, mouseY);
 }

This is a self-portrait created using words that describe who I am as an individual. Labels hold so much power in our culture whether we like it or not, so why not define yourself?

Few Minutes
Many many minutes

Leave a Reply