Sarita Chen – Project 9 – Portrait

sketch

var img;
var pixelSize = 5;
var pixelX;
var pixelY;
function preload(){
	img = loadImage("http://i.imgur.com/oTBE2k6.jpg");
	img.width = 600;
	img.height = 600;
	frameRate(200);

}

function setup() {
    createCanvas(600, 600);
    background(0);
    imageMode(CENTER);
    img.resize(600,600);
    img.loadPixels();

}

function draw() {

	noStroke();
	pixelX = floor(random(width));
	pixelY = floor(random(height));
	var pixelGET = img.get(pixelX,pixelY);

	fill(pixelGET,100);
	rect(pixelX,pixelY,5,5);


}

I used a photo of me, my twin sister and my younger brother from when we were younger. Here are some progress images:

screen-shot-2016-10-27-at-7-26-22-pm    screen-shot-2016-10-28-at-5-03-56-pm

Here is the final thing (or close to the final, there are still some gaps here and there):

screen-shot-2016-10-28-at-6-19-54-pm

 

 

Leave a Reply