jknip-Project-09-portrait

sketch

/*Jessica Nip
Section A
jknip@andrew.cmu.edu
Project-09
*/


var img;

//--------------------------
function preload() {
    //preload grandma's image
    img = loadImage("https://i.imgur.com/G6dnwgf.jpg");

}
 //-------------------------
function setup() {
    createCanvas(342,480);
    img.loadPixels();
    frameRate(200); //set fast frame rate
}
 
 //-------------------------
function draw() {
    //define X and Y pixels of image, randomize appearance position
    var Xpixel = constrain(floor(random(width)), 0, width-1);
    var Ypixel = constrain(floor(random(height)), 0, height-1);
    //image color = grab pixels from image
    var imgcolor = img.get(Xpixel, Ypixel);
    var randomSize = random(5,15);

    //set ellipse color to image pixel color
    fill(imgcolor);
    noStroke(); //remove border
    //set ellipse X and Y to randomized pixel positions
    ellipse(Xpixel, Ypixel, randomSize, randomSize); 
}



For this project, I wanted to create a fun randomized ellipse-based filter generated based on a photo of my grandmother. Below you will find some screenshots at different points of the rendering process. As the colors in the original image were fairly limited and grouped in simple forms, I wanted to use randomized ellipses to suggest those specific colors across the canvas from the beginning — the overall image also becomes more apparent early on due to the high visibility of these core forms.

Leave a Reply