mstropka-Project09-E

sketch

//Max Stropkay
//Section E
//mstropka@andrew.cmu.edu
//Project-09

var underlyingImage;

function preload() {
    var myImageURL = "https://i.imgur.com/j59r16x.jpg";
    underlyingImage = loadImage(myImageURL);
}

function setup() {
    print("made");
    createCanvas(480, 480);
    background(0);
    underlyingImage.loadPixels();
    frameRate(20);
}

function draw() {
var size = 20;
    for(var i = 0; i < 480; i+=10){
      for(var j = 0; j< 480; j+=10){
        fill(underlyingImage.get(i, j));
        ellipse(i+random(-10,10), j+random(-10, 10), size ,size);
      }
    }


}

For my project I took a picture of my friend and replaced every pixel with an ellipse that is filled with the color of the underlying picture. This gives the image a sort of painterly feel. Then I made the ellipses move randomly to give the image a sense of movement.

Leave a Reply