Project-09-Portrait

sketchDownload
// Isabel Xu
//Section A
//yuexu@andrew.cmu.edu
//Project-09


var underlyingImage;
var ix;
var iy;
var px;
var py;

function preload(){
	var myIMG = "https://i.imgur.com/Kks4pC9.jpg"
	underlyingImage = loadImage(myIMG);
}
function setup() {
    createCanvas(735, 595);
    background(255);
    imageMode(CENTER);
    underlyingImage.loadPixels();////get pixels from the picturev
    frameRate(99999999);
}

function draw() {
	var px = random(width); //x position of the storke
    var py = random(height); //y postotion of the stroke
    var ix = constrain(floor(px), 0, width-1); //x position of each pixel
    var iy = constrain(floor(py), 0, height-1); //y position of each pixel
    var theColorAtLocationXY = underlyingImage.get(ix, iy);//get the color of each pixel

    noStroke();
    fill(theColorAtLocationXY);
    drawStar(px,py);

}
//star shape
function drawStar(px,py){
	beginShape();
	vertex(px-4,py-15);
	vertex(px-3.5,py-19);
	vertex(px-6,py-22);
	vertex(px-2,py-22);
	vertex(px,py-26);
	vertex(px+2,py-22);
	vertex(px+6,py-22);
	vertex(px+3.5,py-19);
	vertex(px+4,py-15);
	vertex(px,py-17);
	endShape();
}
programs runs for 1 min
more completed result
The portrait is a collage of myself.
Medium: Photography and oil paint

In the self-portrait, I want to bring in the gentleness and floating elements of water and the dreamy stars effect to the scene.

Leave a Reply