Project-09-Portrait

sketch

I chose the photo I took in LA. So, I decided it to draw and color with the text “LA” according to the mouse position, along with the pixels draw and color with the rectangle.

original photo
after first few seconds
after few minutes
after few more minutes

//Jae Son , Section C

var Jae;

function preload() { 
  var imageURL = "https://i.imgur.com/BGjhuqC.jpg";
  Jae = loadImage(imageURL);
}

function setup() {
  createCanvas(480, 480);
  background(255);
  frameRate(10000);
  Jae.loadPixels();  
  Jae.resize(480,480);
}

function draw() {
  
 var x = random(width);
 var y = random(height);
  
 var ix = constrain(floor(x), 0, width);
 var iy = constrain(floor(y), 0, height);
  
 var clr = Jae.get(x, y);
 var mouseclr = Jae.get(mouseX, mouseY);
  
//fill and color pixels with rectangle
 noStroke();
 fill(clr);
 rect(x,y,10,10);
  
//draw and color text "LA" at my mouse location
 fill(mouseclr);
 textSize(16);
 textStyle(BOLD);
 text("LA",mouseX,mouseY);
}

Leave a Reply