dnam-project-09

sketch

var jisoo;

function preload() { //load the images for underlay
    var geum = "https://i.imgur.com/tG77kDu.jpg";
    jisoo = loadImage(geum);
}

function setup() {
    createCanvas(800, 700);
    background(100); 
    jisoo.loadPixels(); //load up colors of the pixels from the photo
    frameRate(1000);
}

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 coLoc = jisoo.get(ix, iy); 

    stroke(coLoc); 
    noFill();
    ellipse(px, py, random(6, 20), random(6, 15)); //each ellipses are somewhat random to create
    //different image with a similar style

}

Using the sample code, I altered how the canvas would fill up. By using ellipses with no fill, I was able to create a sketchy yet vague paint style. By adding a random element to the code, I am able to create different results with the same style.

Leave a Reply