Kevin Riordan Project-10-Landscape

kzr sketch 10

/*Kevin Riordan
Section C
kzr@andrew.cmu.edu
project_10*/
var trees = [];//make empty trees array

function setup() {
    createCanvas(480, 480); 
    for (var i = 0; i < 6; i++){
        var randX = random(-width/5,width + (width / 3));//putting in 6 trees at the start
        trees[i] = makeTree(randX);
    }
    frameRate(10);//setting framerate
}

function draw() {
    background('#D8BFD8'); //setting background color
    makeBackestMountains();//furthest mountains
    makeBackMountains();//next furthest mountains
    updateAndDisplayTrees();//moving and displaying trees
    removeTreesThatHavePassed();//taking out trees that are safely offscreen
    addNewTreesProb();//putting in new trees sometimes
    makeFrontMountains();//make foreground
}
//updates and displays trees as they move to the left
function updateAndDisplayTrees(){
    for (var i = 0; i < trees.length; i++){
        trees[i].move();
        trees[i].display();
    }
}
//takes trees out of array once they are safely off screen
function removeTreesThatHavePassed(){
    var treesKept = [];
    for (var i = 0; i < trees.length; i++){
        if (trees[i].x > -width / 3) {
            treesKept.push(trees[i]);
        }
    }
    trees = treesKept;
}
//adds new trees with set chance
function addNewTreesProb() {
    var newTreeChance = 0.02; 
    if (random(0,1) < newTreeChance) {
        trees.push(makeTree(width + (width / 3)));
    }
}
//moves trees at 2 pixels per call
function treeMove() {
    this.x += this.speed;
}
//makes trees with specified things
function makeTree(xCoord) {
    var tree = {x: xCoord, speed: -2.0, move: treeMove, display: treeDisplay, size: random(0.5,1.3), grad: round(random(0,3))}
    return tree;
}
//draws tree recursively with fractals
function drawTree(x, y, angle, depth, size){
    if(depth != 0){
        var x2 = x + (Math.cos(angle) * 10 * size * depth);
        var y2 = y + (Math.sin(angle) * 15 * size * depth);
        line(x, y, x2, y2);
        drawTree(x2, y2, angle - (PI / 8), depth - 1, size);//left side of tree
        drawTree(x2, y2, angle + (PI / 8), depth - 1, size);//right side of tree
    }
}
//sets color based on the grad, 4 different colors possible
function treeDisplay(){
    var treeColor;
    if(this.grad == 0) {
        stroke('#FFF8DC');
    }
    if(this.grad == 1) {
        stroke('#FFEBCD');
    }
    if(this.grad == 2) {
        stroke('#FFE4C4');
    }
    if(this.grad == 3) {
        stroke('#FFDEAD');
    }
    strokeWeight(2);
    drawTree(this.x, height-30, -PI / 2, 6, this.size);//draws actual tree with fifth parameter changing the overall scale of it
}
//makes foreground with given detail, moves at same speed as trees
function makeFrontMountains() {
    var terrainSpeed1 = 0.00005;
    var terrainDetail1 = 0.005;
    stroke('#DAA520'); 
    beginShape(); 
    for (var x = 0; x < width; x++) {
        var t = (x * terrainDetail1) + (millis() * terrainSpeed1);
        var y1 = map(noise(t), 0,1, 400, height-30);
        line(x,y1,x,height); 
    }
    endShape();
}
//makes mountains in background, moves slower than trees and foreground
function makeBackMountains() {
    var terrainSpeed2 = 0.000025;
    var terrainDetail2 = 0.005;
    stroke('#A0522D'); 
    beginShape(); 
    for (var x2 = 0; x2 < width; x2++) {
        var u = (x2 * terrainDetail2) + (millis() * terrainSpeed2);
        var y2 = map(noise(u), 0,1, 150, height - 30);
        line(x2,y2,x2,height); 
    }
    endShape();
}
//makes furthest mountains, moves very slowly
function makeBackestMountains() {
    var terrainSpeed3 = 0.0000125;
    var terrainDetail3 = 0.01;
    stroke('#BC8F8F'); 
    beginShape(); 
    for (var x3 = 0; x3 < width; x3++) {
        var v = (x3 * terrainDetail3) + (millis() * terrainSpeed3);
        var y3 = map(noise(v), 0,1, 110, height - 150);
        line(x3,y3,x3,height); 
    }
    endShape();
}

I found the template for this project very helpful, but the part of this project that took me the most time was figuring out how to make the trees look more realistic. I used recursion and fractals to make the trees look nice, and realizing that I could call the same function inside of itself took a while for me to figure out. I also played around with speeds to make different things move at different speeds. I also found a website that gives color names for different colors, so I like the way my colors fit together for this project. This project made me really comfortable with functions and how they work together. I made the project look pretty close to how I wanted it to look which I am proud of.

sketch for project 10 landscape

Christine Seo – Project 10 – Landscape

sketch

// Christine Seo
// Section C
// mseo1@andrew.cmu.edu
// Project-10

var clouds = [];
var terrainSpeed = 0.001;
var terrainDetail = 0.01;

function setup() {
    createCanvas(300,400); 
    for (var i = 0; i < 8; i++){ //clouds forloop for array
        var rx = random(width);
        clouds[i] = drawCloud(rx);

    }
    frameRate(50);
}

function draw() {

    sky(0, 0, width, height);
    updateAndDisplayClouds();
    removeCloudsThatHaveSlippedOutOfView();
    addNewCloudsWithSomeRandomProbability();
    planeWindow();
}

function sky(x, y, w, h) { //drawing sky
    var colorDark;
    var colorLight;    
    
    colorDark = color(13, 91, 245);
    colorLight = color(194, 225, 255);
    for (var i = y; i <= y + h; i++) {
        var inter = map(i, y, y + h, 0, 1.5);
        var c = lerpColor(colorDark, colorLight, inter);
        stroke(c);
        line(x, i, x + w, i);
    
    }

    beginShape(); //drawing mountains
    noFill(); 
    stroke(56, 89, 9);
    strokeWeight(100);
    for (var x = 0; x < width; x++) {
        var t = (x * terrainDetail) + (millis() * terrainSpeed);
        var y = map(noise(t), 0,1, 150, 250);
        vertex(x, y + 200); 
    }
    endShape();


  }

  this.display = function() {
    strokeWeight(this.border);
    stroke(255);
    fill(255);
    ellipse(this.x, this.y,  this.di,  this.di);

  }

function planeWindow(){


	beginShape(); //outter black frame
	stroke(0);
	strokeWeight(70);
	noFill();
	rect(0,-10,310,420,100);
	endShape();

	beginShape(); // wings top triangle
	noStroke();
	fill(90);
	triangle(120,220,120,180,140,230);
	endShape();

	beginShape(); // wings bottom
	noStroke();
	fill(20);
	triangle(140,250,220,231,250,260);
	triangle(180,280,260,251,250,280);
	endShape();

	beginShape(); // wings
	noStroke();
	fill(50);
	triangle(300,240,120,220,280,300);
	endShape();

    beginShape(); //window shield 
    stroke(120);
    strokeWeight(14);
    noFill();
    rect(20,20,width - 40,height - 40,100);
    endShape();

    beginShape();
    stroke(0);
    strokeWeight(7);
    noFill();
    rect(29,24,width - 59,height - 50,100);
    endShape();
 
    beginShape();
    stroke(240);
    strokeWeight(5);
    noFill();
    rect(13,9,width - 25,height - 20,120);
    endShape();
}

function updateAndDisplayClouds(){
    for (var i = 0; i < clouds.length; i++){
        clouds[i].move();
        clouds[i].display();
    }
}


function removeCloudsThatHaveSlippedOutOfView(){
    
    var cloudsToKeep = [];
    for (var i = 0; i < clouds.length; i++){
        if (clouds[i].x + clouds[i].breadth > 0) {
            cloudsToKeep.push(clouds[i]);
        }
    }
    clouds = cloudsToKeep; // keeping the clouds 
}


function addNewCloudsWithSomeRandomProbability() {
    
    var newBuildingLikelihood = 0.01; 
    if (random(0,0.5) < newBuildingLikelihood) {
        clouds.push(drawCloud(width));
    }
}



function cloudMove() {
    this.x += this.speed;
}
    


function cloudDisplay() {
    var floorHeight = 20;
    var cloudHeight = this.nFloors * floorHeight; 
    
    fill(255,100); 
    noStroke(); 
    push();
    translate(this.x, height - 35);
    ellipse(95, -cloudHeight, this.breadth, cloudHeight / 2);
    pop();

    push();
    fill(255,70)
    translate(this.x, height - 55);
    ellipse(95, - cloudHeight -200, this.breadth, cloudHeight);
    pop();
}


function drawCloud(birthLocationX) {
    var bldg = {x: birthLocationX,
                breadth: random(90, height),
                speed: -random(1,2.5),
                nFloors: round(random(4,9)),
                move: cloudMove,
                display: cloudDisplay}
    return bldg;
}

I wanted to portray a scene inside of an airplane because when I think of looking at a moving landscape, it is usually in a car or a plane. I randomized the clouds and their sizes as well. I wanted to add some sort of ground to make it not look like I’m too high up in the air to add more dynamic elements (I am also scared of heights). I think it was kind of hard to understand the concept of making the landscape “generative,” in the beginning. But, I was able to understand it after looking through the notes again. The foreground is clear due to the frame of the airplane and there are additional elements to visual display that background and the mid-ground.  I also tried to make a color scheme and I am quite pleased with the overall product!

Thumbnail sketch of what I wanted to make (inside of plane)

Christine Seo- Looking Outwards 10

Sorting Feminist Data collected at SOHO20, July 2018
Installation shot of piece, SOHO20 March 2018
First workshop for Feminist Data Set, SPACE Art and Technology, October 2017

Caroline Sinders is a machine learning designer, user researcher, artist, and digital anthropologist who produced the project, Feminist Data Set. She has been focusing on the intersections of natural language processing, artificial intelligence, abuse, and online harassment. She currently works at BuzzFeed/Eyebeam Open Labs and lives in Brooklyn, NY. She was born in New Orleans and has a masters from NYU’s Interactive Telecommunications Program focusing on HCI, storytelling, and social media theory. Feminist Data Set is a project that started in October 2017 which calls to action to collect feminist data.  This data set compiles art works, essays, interviews, and books that are from, about or explore feminism and a feminist perspective. The series explores how data and interfaces can be agents of change within machine learning systems that are utilized by the public and private sectors of our daily lives.

Sinders was heavily influenced by the idea to remove bias within machine learning, which has to be manifested into a learning experience to teach or sway the algorithms. She also aims to initiate a standard for equity and equality, by centering collaboration in the creation of this data set. I thought that this project was very intriguing because she is a female artist that focuses on feminism. A lot of people are very hesitant to approach this topic, but I appreciate her effort to conceptually organize her thoughts into a data set and use it through design and machine learning. This concept and idea is very unique and different from all of the other ideas I’ve approached in looking outwards research, so it was great to find something that I strongly resonate with outside of visual forms of art!

Kevin Thies – Project 10

mountain roads

// Kevin Thies
// Section C
// kthies@andrew.cmu.edu
// Project 10 - Generative Landscape

// initiate containers for mountains, trees, and posts
var mountains = [];
var trees = [];
var posts = [];

// keeps track of time for post spawning
var timer = 0;

// preset y values to act as "layers"
var layer = [470, 435, 400, 380, 320, 290];


function setup() {
    createCanvas(480, 480);

    // add starting mountains
    for(var i = 0; i < 15; i++) {
        var randomX = random(width);
        mountains[i] = makeMountain(randomX, 5);
    }

    // add starting trees
    for(var i = 0; i < 100; i++) {
        var randomX = random(width);
        trees[i] = makeTree(randomX, 5);
    }

    // add closer starting trees with different speed and color
    for(var i = 100; i < 200; i++) {
        var randomX = random(width);
        var newTree = makeTree(randomX, 4);
        newTree.color = color(10,0,29);
        newTree.speed = 0.9;
        trees[i] = newTree;
    }
}

function draw() {

    // background
    background(12,24,68);
    strokeWeight(3);
    backgroundGradient();
    strokeWeight(0);

    // sun
    strokeWeight(0);
    fill("lemonchiffon");
    ellipse(width / 2, layer[5], 100, 100);

    // ground
    fill(12,24,68);
    rectMode(CORNERS);
    rect(0, layer[5], width, height);
    fill(10,0,29);
    rect(0, layer[4], width, height);

    // mountains
    strokeWeight(0);
    updateAndDisplayMountains();
    removeOffscreenMountains();
    addNewMountains();

    // trees at base of mountain
    updateAndDisplayTrees();
    removeOffscreenTrees();
    addNewTrees();
    addNewCloserTrees();

    // highway railing
      // posts
    updateAndDisplayPosts();
    removeOffscreenPosts();
    addNewPosts();

      // solid barrier part of the rail
    fill(40,37,31);
    rect(0, layer[2], width, layer[0]);
    stroke(98,87,93);
    strokeWeight(3);
    line(0, layer[2], width, layer[2]);
    strokeWeight(0);
    rectMode(CENTER);
    fill(24,12,14);
    rect(width/2, layer[1], width, 40)
}

// POSTS //////////////////////////////////////////////////////////////////

// moves the existing posts
function updateAndDisplayPosts() {
    for(var i = 0; i < posts.length; i++) {
        posts[i].move();
        posts[i].display();
    }
}

// removes the posts that are offscreen
function removeOffscreenPosts() {
    // if posts are offscreen, don't re-add them to posts[]
    var postsToKeep = [];
    for(var i = 0; i < posts.length; i++) {
        if (posts[i].x + 40 > 0) {
            postsToKeep.push(posts[i]);
        }
    }
    posts = postsToKeep;
}

// adds the new posts
function addNewPosts() {
    // every 40 frames, shoot in a new post
    timer ++;
    if(timer == 40) {
        timer = 0;
        posts.push(makePost(width))
    }
}

// how posts are made
function makePost(px) {
    var post = {x: px,
                speed: 12,
                display: postDisplay,
                color: color(98,87,93),
                color2: color(40,37,31),
                move: postMove,
    }
    return post;
}

// is how to move the posts
function postMove() {
    this.x -= this.speed;
}

// builds the posts from the this.x coordinate
function postDisplay() {
    stroke(this.color);
    strokeWeight(3);
    //       |      part of post
    line(this.x, height, this.x, layer[2] - 20);
    //      / /     part of post
    line(this.x, layer[2] - 20, this.x - 10, layer[2] - 10);
    line(this.x - 20, layer[2] - 20, this.x - 30, layer[2] - 10);
    //       -      part of post
    line(this.x - 5, layer[2] - 15, this.x - 25, layer[2] - 15);
    strokeWeight(0);
}

// TREES //////////////////////////////////////////////////////////////////

// how trees are made
function makeTree(tx, layer) {
    var tree = {x: tx,
                layer: layer,
                speed: 0.7,
                display: treeDisplay,
                color: color(12,24,68),
                move: treeMove,
                scale: random(0.5, 1)};
    return tree;
}

// how the trees are moved
function treeMove() {
    this.x -= this.speed;
}

// builds the far trees from an x coordinate
function treeDisplay() {
    fill(this.color);
    ellipse(this.x, layer[this.layer], 20 * this.scale, 20 * this.scale);
}

// moves existing trees
function updateAndDisplayTrees() {
    for(var i = 0; i < trees.length; i++) {
        trees[i].move();
        trees[i].display();
    }
}

// removes trees that are offscreen
function removeOffscreenTrees() {
    // if tree is offscreen, don't re-add it to trees[]
    var treesToKeep = [];
    for(var i = 0; i < trees.length; i++) {
        if (trees[i].x + 20 > 0) {
            treesToKeep.push(trees[i]);
        }
    }
    trees = treesToKeep;
}

// random chance generates a new tree on layer 5
function addNewTrees() {
    var newTreeChance = 0.1;
    if(random(0,1) < newTreeChance) {
        trees.push(makeTree(width, 5))
    }
}

// random chance generates a new tree on layer 4 with fitting color and speed
function addNewCloserTrees() {
    var newTreeChance = 0.1;
    if(random(0,1) < newTreeChance) {
        var newTree = makeTree(width, 4);
        newTree.color = color(10,0,29);
        newTree.speed = 0.9;
        trees.push(newTree);
    }
}

// BACKGROUND //////////////////////////////////////////////////////////////

// makes the gradient seen in the background from y = 0 to layer 5
function backgroundGradient() {
    for(var i = 0; i < layer[5]; i++) {
        var g = map(i, 0, layer[5], 0, 140);
        stroke(255, g, 0);
        line(0, i, width, i);
    }
}

// MOUNTAINS //////////////////////////////////////////////////////////////

// moves existing mountains (so strong)
function updateAndDisplayMountains() {
    for(var i = 0; i < mountains.length; i++) {
        mountains[i].move();
        mountains[i].display();
    }
}

// removes mountains that are offscreen
function removeOffscreenMountains() {
    // if mountain is offscreen, don't re-add it to mountains[]
    var mountainsToKeep = [];
    for(var i = 0; i < mountains.length; i++) {
        if (mountains[i].x + (200 * mountains[i].scale) > 0) {
            mountainsToKeep.push(mountains[i]);
        }
    }
    mountains = mountainsToKeep;
}

// random chance generates a new mountain
function addNewMountains() {
    var newMountainChance = 0.01;
    if(random(0,1) < newMountainChance) {
        mountains.push(makeMountain(width, 5))
    }
}

// how mountains are made
function makeMountain(mx, layer) {
    var mountain = {x: mx,
                    layer: layer,
                    speed: 0.5,
                    display: mountainDisplay,
                    color: color(85,54,86),
                    color2: color(85, 54, 106),
                    move: mountainMove,
                    scale: random(0.5, 1)};
    return mountain;
}

// how mountains are moved
function mountainMove() {
    this.x -= this.speed;
}

// actually builds the moutain based off an x coordinate
function mountainDisplay() {
    fill(this.color);
    triangle(this.x, layer[this.layer],
         this.x + (200 * this.scale), layer[this.layer],
         this.x + (100 * this.scale), layer[this.layer] - (180 * this.scale));
    fill(this.color2);
    triangle(this.x + (170 * this.scale), layer[this.layer],
              this.x + (200 * this.scale), layer[this.layer],
              this.x + (100 * this.scale), layer[this.layer] - (180 * this.scale));
}

// Congradulations, you made it to the end! *confetti emoji*

At first when I was thinking about what to do, I thought about long car rides through the mountains. I sketched up an idea that involved cars going different directions, but after implementing the moving mountains, I realized I had to simplify my idea. I kept the most important part of that, the mountains, and rebuilt from there. I think having all the layers helps add some measurable scale to the mountains and trees in the background. I’m also just really with how it turned out, and although making the objects got tedious, once I had one and understood how the pieces fit together, it really sped up from there.

My plan involving mountains, roads, and layers

Joanne Lee – Project 09

Project 09

// Joanne Lee
// Section C
// joannele@andrew.cmu.edu
// Project-09

var christine;

function preload() {
    var myImageURL = "https://i.imgur.com/beoY7rv.jpg"; // load image
    christine = loadImage(myImageURL);
}

function setup() {
    createCanvas(480, 480);
    background(0);
    christine.loadPixels();
    frameRate(50000000);
}

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 rx = px + random(0,6); // randomize line x-value
    var ry = py + random(0,4); // randomize line y-value
    var rs = random(1,4); // randomize stroke weight
    var theColorAtLocationXY = christine.get(ix, iy);

    strokeWeight(rs);
    stroke(theColorAtLocationXY);
    line(px,py,rx,ry);
}

I chose a photo of my gorgeous current roommate (although the style of the photo made it hard to really capture her eyes!). I knew I wanted to do lines in order to emulate “strokes” and to further emulate this, I tried to vary the stroke weights as well as direction and lengths of the line. I didn’t want to make the line extend too far in order to ensure that facial features could moderately be made out.

I very much admire impressionist type paintings and so I tried to emulate thicker brush strokes. I made the frame rate ‘50000000’ because I preferred to see the photo render quickly. Below are photos further in to rendering and near completion.

Midway through full rendering
Almost fully done rendering
Original Photo of Christine Seo

Joanne Lee – Looking Outwards 09

Nunu & Willump League of Legends Champion Spotlight

In Robert Oh’s first Looking Outward, he reviewed the visual game update of a longtime League of Legends (multiplayer online game) champion. He mentioned that, “Riot is aiming towards making their boring characters more interesting by adding new skills that make them feel more fun to play.” As an avid player of this game, I wholeheartedly agree with this statement. Although I only started playing League of Legends 2 years ago, I find that something that keeps me engaged in the game is the consistent changes they make to their champions, gameplay, items, and abilities. This is a very great strategy implemented by Riot Games to keep the game feeling fresh despite the base mechanics of the game remaining the same.

One aspect I would like to clarify on is when Robert states that every couple months, Riot chooses to to update old characters to make them feel fresh and new. The original Nunu was released far back on February 21, 2009. The updated Nunu was released on August 29, 2018. It took about 9 years for them to update this champion. Many other champions are also waiting on a visual game update. My hypothesis is that they want to make sure that their updates will be radical and refreshing and not just minor changes. In between, they will often release brand new champions, further delaying the updates of previous champions.

As a player of this champion, the visual game update proved to be very exciting and worth the wait. I hope Riot will continue to re-envision their previous art and champion styles in order to keep the game a fresh and exciting game to play!

Robert Oh- Project 09- Portraits

chris

//Robert Oh
//Section C
//rhoh@andrew.cmu.edu
//Project-09-Portrait

var Chris;

function preload() {
    var myImageURL = "https://i.imgur.com/0FU7jf7.jpg?1";
    Chris = loadImage(myImageURL);
}

function setup() {
    createCanvas(480, 367);
    background(0);
    Chris.loadPixels();
    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 col = Chris.get(ix, iy);

    //randomly creating the X length and thickness
    var len = random(2, 7);
    var thick = random(1, 5);

    //creating the X's
    stroke(col);
    strokeWeight(thick);
    line(px - len, py - len, px + len, py + len);
    line(px - len, py + len, px + len, py - len);
}

For this project, I used a photo of my friend, Chris. I thought the X’s were a nice touch and I liked how I generated the X’s using randomness (in both the length and the thickness.

This is a photo of the early stage:

This is the final product:

(The original photo was of my friend sitting on a colorful staircase)

 

Robert Oh- Looking Outwards-09

James White- Early Forge random output using Vormator shapes Version 4 (2007)

For this week’s Looking Outwards, I decided to use Joanne Lee’s Looking Outwards-06 Post.

I really appreciate randomness and how White was able to use it in order to create such beautiful art. His program, Forge, creates art pieces where many features and elements are all random and out of his control. I really do love how art can look so amazing complex and detailed despite the fact that everything was created randomly. Supporting Joanne’s opinion, I really do appreciate the fact that White created this program to allow other artists to use to also implement randomness in their art.

 

 

Rjpark – Looking Outwards 09

3D Printed Flexible Shoes

My peer’s looking outwards was about 3D printing, specifically 3D printing flexible shoes. My peer stated that he thinks it’s interesting how practical 3D printing has become and how it could help create other useful every day life things in the future. I agree with my peer in that it is amazing how 3D printing has turned into a process for the creation of even the simplest, most practical objects. In addition, it could possibly replace other methods of creating useful products we use in our daily lives and be more efficient/save raw material utilization.

But, even though it seems like 3D printing’s becoming more popular and being used more often, I wonder if it’s worth to use it to create practical daily life objects. When I watched the video about the shoes (link below), I saw that the shoes weren’t exactly fulfilling its purpose properly. They seemed to be made of material that’s either too hard or too flexible, making them too rigid/uncomfortable or not sturdy enough. It made me think about whether it’s worth it to use 3D printing for a product this practical, when it can’t do its job as well as the shoes we have now. The only time I think 3D printing practical objects might really be useful for is when we’re trying to create products of minimal productivity for people who can’t afford the best version of that object, similar to one laptop per child. As a result, I think it really depends on efficiency of 3D printing practical objects, the audience its targeted at, and how much better the 3D printed object is from the current one.

Peer’s Looking Outward

3D Printed Shoes Link

Rjpark – Project 08 – Computational Portrait

computationalportrait

var image;

function preload() {
	// directly loading image through website (no URL variable)
    image = loadImage("https://scontent.fagc2-1.fna.fbcdn.net/v/t31.0-8/c87.61.576.576/p720x720/27788553_1801115783266418_6212879640355992453_o.jpg?_nc_cat=110&_nc_ht=scontent.fagc2-1.fna&oh=cc9c38dd3d5a14dcb13a012cd0973bd2&oe=5C7EA0C1");
}

function setup() {
    createCanvas(480, 480);
    background(0);

    image.loadPixels();
    // makes the pixels load faster
    frameRate(500000000000000);
}

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

    noStroke();
    fill(color);
    // pixels are smaller to make the portrait more detailed
    rect(px, py, 3, 3);
}

At first, I had trouble finding a photo that would fit well into the 480 by 480 canvas so I had to look through multiple photos on different websites to find a photo that would be the perfect size. However, once I found that photo, it was easy to make a computational portrait out of it. I used 3 by 3 rectangles as my surface treatment. Because I made my rectangles so small, I had to increase frame rate to 500 trillion for the portrait to be drawn faster. The final result is below!!