alchan-Project 09-portrait


var portraitImg;
var rotateAngle;

function preload() {
    var portraitLink = "";
    portraitImg = loadImage(portraitLink);

function setup() {

function draw() {
    for(var y = 0; y <= height; y+=15) {
      for(var x = 0; x <= width; x+=15) {
        var pixelColor = 10 + brightness(portraitImg.get(x, y));
        var mouseDist = dist(mouseX, mouseY, x, y);
        strokeWeight(map(mouseDist, 0, 679, 0.5, 8));
        translate(x, y);
        rotate(map(mouseDist, 0, 679, 0, 360));
        line(0-3, 0, 0+3, 0);
        line(x, y-3, x, y+3);

For my portrait, I knew I wanted to have the entire picture rendered at first, and user interaction to change the portrait somehow. I decided to go with a somewhat abstract grid of crosses to represent the picture at first, using the source image’s brightness values instead of colors to create a more cohesive image. (The source image is an extremely cropped view of a face from the eyes up, in case you couldn’t make it out.) The crosses change thickness (and the horizontal bar rotates) depending on how far away the mouse is, obscuring areas of the image the mouse is closest to. Unfortunately the program runs a little slow for me, so it’s not quite the experience I had planned, but it’s as close as I could get.

Leave a Reply