creyes1 Project-09 (Portrait)
var underlyingImage;
function preload() {
underlyingImage = loadImage('https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/10/creyes1_15104pic.jpg');
}
function setup() {
createCanvas(480, 480);
background(255);
underlyingImage.loadPixels(); frameRate(60);
}
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 = [red(underlyingImage.get(ix, iy)) + 20,
green(underlyingImage.get(ix, iy)),
blue(underlyingImage.get(ix, iy)),
70];
var rectSize = random(10, 20);
rectMode(CENTER);
noStroke();
fill(theColorAtLocationXY);
rect(px, py, rectSize, rectSize*3);
drawDetailPixel(width/2, 50, 145, 200, 10);
drawDetailPixel(width/2 - 10, 50, 240, 300, 10);
}
function drawDetailPixel(xmin, xmax, ymin, ymax, pixelSize) {
var dpx = randomGaussian(xmin, xmax);
var dpy = random(ymin, ymax);
var dix = constrain(floor(dpx), 0, width-1);
var diy = constrain(floor(dpy), 0, height-1);
var detailColXY = [red(underlyingImage.get(dix, diy)) + 20,
green(underlyingImage.get(dix, diy)),
blue(underlyingImage.get(dix, diy)),
35];
fill(detailColXY);
rect(dpx, dpy, pixelSize, pixelSize);
}
function mousePressed() {
fill(red(underlyingImage.get(mouseX, mouseY)) + 20,
green(underlyingImage.get(mouseX, mouseY)),
blue(underlyingImage.get(mouseX, mouseY)),
35);
stroke(255, 255, 255, 35);
strokeWeight(1);
ellipse(mouseX, mouseY, random(150, 250));
}
While I didn’t run into too many issues with this project in terms of implementation, I did have some issues with finding a balance between keeping it visually interesting while avoiding having too much visual noise that it becomes confusing to look at. I really liked the idea that this was a program that would continue to loop and build upon itself, and so opted for various degrees of transparency so that the image would become more clear as the program ran. I also made it a point to highlight certain areas of the image, such as the eyes and mouth, with smaller transparent squares to build up some more defined shapes so that it would be easier to pick out a face from the constantly layering rectangles. I really like the interaction between the analog brush marks in the portrait with the computational pixels in the program, where it creates something almost painterly, yet not quite glitch art, but a really interesting in-between.

Original Self Portrait




Development of the portrait as the program runs and manual mouse clicks are introduced