Sean Meng-Project-09-Custom Pixel

hmeng-project 09

//Sean Meng
//hmeng@andrew.cmu.edu
//Section C
//Project-09-Custom Pixel

var underlyingImage;

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

function setup() {
    createCanvas(500, 500);
    background(0);
    underlyingImage.loadPixels();
    frameRate(70);
}

function draw() {
    var x = random(width);
    var y = random(height);
    var ix = constrain(floor(x), 0, width-1);
    var iy = constrain(floor(y), 0, height-1);
    var theColorAtLocationXY = underlyingImage.get(ix, iy);

//set randomized dimensions for the geometry
    var a1 = random(2, 10);
    var a2 = random(8, 15);
    var a3 = random(2, 15);
    var b1 = random(10, 20);
    var b2 = random(20, 50);

    noStroke();
    fill(theColorAtLocationXY);

//draw quadrians according to the image
    quad(x, y, x + a1, y - b1, x + a2, y, x + a3, y + b2);

//draw ellipses in random sizes along the mouse
    var theColorAtTheMouse = underlyingImage.get(mouseX, mouseY);
    stroke(theColorAtTheMouse);
    ellipse(pmouseX, pmouseY, random(5, 20));


}

//refresh the canvas when the mouse is pressed
function mousePressed(){
    clear();
}

In this project I chose a portrait of myself that was taken by someone else. To represent the portrait in a more interesting way, I explored different geometries and layered them together.

After 20 seconds
After 40 seconds

Julia Nishizaki – Project 09 – Computational Portrait

sketch

//Julia Nishizaki
//Section B
//jnishiza@andrew.cmu.edu
//Project 09 - Computational Portrait

var siblingImage;

function preload() { // load image
    var siblingImageURL = "https://i.imgur.com/oi1ahe3.jpg";
    siblingImage = loadImage(siblingImageURL);
}

function setup() {
    createCanvas(320, 480); // same ratio as photo, 2:3
    background('white'); // white background
    rectMode(CENTER);
    siblingImage.loadPixels();
    frameRate(1000); // beginning frame rate
}

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 theColorAtLocationXY = siblingImage.get(ix, iy);
    var psize = map(mouseY, 0, height, 1, 7); // size of rectangles based on y coordinate of mouse
    var pcorner = 1; // how curved the corners of the rectangle are
    var pdimenW = map(mouseX, 0, width, 4, 8); // As mouse moves to right, width increases, height decreases
    var pdimenH = map(mouseX, 0, width, 8, 4); // As mouse moves to left, height increases, width decreases

    noStroke();
    push()
    translate(px, py);
    if (mouseIsPressed) { // if mouse is pressed, rectangles are rotated 45 degrees
        rotate(PI / 4);
    }
    scale(psize); // rectangle size increases and decreases as mouse moves vertically
    fill(theColorAtLocationXY);
    rect(0, 0, pdimenW, pdimenH, pcorner, pcorner, pcorner, pcorner); //creates colored squares
    pop();
}

For this project, I chose a photo of my siblings and I when we were younger (I’m the one who’s lying on the floor half covered by a blanket). I wanted to create something that was fun and interactive, while also obscuring the contents of the photo a little, allowing you to view different layers of information, and conveying the emotions and silliness of that memory. The rectangles scale in size, width and height depending on the coordinates of the mouse, and when you click, the rectangles rotate 45 degrees.

This is the photo I used, my older sister and brother are looking at the camera, and I’m on the floor
Using rectangles at the smallest scale

Cathy Dong – Project 09 – Portrait

sketch

/* Cathy Dong
   Section D
   yinhuid@andrew.cmu.edu
   Project 09 - Portrait
*/

// load image as color base
var baseImg;

// preload base image
function preload() {
    var img = "https://i.imgur.com/zdFmG5k.jpg";
    baseImg = loadImage(img);
}

function setup() {
    createCanvas(480, 480);
    background(0);
    baseImg.loadPixels(); //load image pixels
    frameRate(100000); //set draw circle speed with framerate
}

function draw() {
    // set random x and y to make points
    var px = random(width);
    var py = random(height);
    // constrain to keep x and y within canvas
    var ix = constrain(floor(px), 0, width-1);
    var iy = constrain(floor(py), 0, height-1);
    // fill with base image color
    var colorXY = baseImg.get(ix, iy);
    // change circle size based on distance to center
    var distance = dist(px, py, width / 2, height / 2);
    var cirSize = map(distance, 0, sqrt(2) * width / 2, 10, 25);

    // draw circles
    noStroke();
    fill(colorXY);
    circle(px, py, cirSize);

}

In this project, I used dots/ circles to draw the abstracted self-portrait. Since my face is centered in the image, I used smaller circles near center and larger ones on the canvas edges. The idea is to have finer resolution on the face, whereas the background is blurred. 

Drawing in process (start)
Drawing in process (general figure)
Drawing in process (better resolution)

Rachel Shin – Project 09 – Portrait

reshin-project-09

/*
Rachel Shin
reshin@andrew.cmu.edu
15-104 Section B
Project 09 - Computational Portrait: Michelle
*/

var michelle;

function preload() {
//load image from imugr.com
    var myImageURL = "https://i.imgur.com/5AfjBeG.jpg";
    michelle = loadImage(myImageURL);
}

function setup() {
    createCanvas(500, 500);
    background(0);
    michelle.loadPixels();
    frameRate(200);
}

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

    noStroke();
    fill(theColorAtLocationXY);
    text("One FaceTime Away", px, py);
}

For this project, I decided to use a photo of one of my closest and best friends from home, Michelle. Ever since we met at orchestra camp, we didn’t get to see each other too often because we went to different high schools. Even now, she goes to school in Georgia now, so I don’t get to see her as often as I’d want. Both in high school and in college, we always remind each other that we’d be “One FaceTime Away,” and that became the basis and foundation of our time as best friends.

I found it fun to play around with what variable and pixel shapes I could change especially to literally compute an image that represented my friendship with Michelle.

Rendering
Fully Rendered
Original image of my number one cheerleader

Aaron Lee-Project-09- Portrait


sketch

/*
Aaron Lee
Section C
sangwon2@andrew.cmu.edu
Project-09-Computational Portrait
*/
         
var theImage

function preload() {
   var imageLocation = "https://i.imgur.com/OVTGqnb.jpg"; //preload the theImage from link
   theImage = loadImage(imageLocation);
}

function setup() {
   createCanvas(240, 260);
   background(0);
   theImage.loadPixels();
   frameRate(1000);
   colorMode(RGB);
}

function draw() {
   var pixelX = random(0, width); //random x coordinate of a pixel
   var pixelY = random(0, height); //random y coordinate of a pixel
   var iX = constrain(floor(pixelX), 0, width - 1);
   var iY = constrain(floor(pixelY), 0, height - 1);
   var pixelColor = theImage.get(iX, iY);//getting color info for rectangle fill
   var rectLength = map(brightness(pixelColor), 0, 50, 0, 10);
   var imageatthemouse = theImage.get(mouseX, mouseY); //pixel at the mouse position

   fill(pixelColor);
   rectMode(CENTER);
   rect(pixelX, pixelY, 4, rectLength);
   noFill();
   stroke(imageatthemouse);
   rect(pmouseX, pmouseY, 10, 10);
}

I chose a portrait of myself with high frame rate in order to see quick change. The rectangles with random size and appropriate stroke give a balanced finished look at the end. The portrait is also user interactive with mouse that creates hollow rectangles.

Rachel Shin – LO 9

I decided to do this week’s Looking Outwards on my friend Joseph Zhang’s LO-7 which was on the eCloud project in the San Jose Airport. Coming from the same hometown as Joseph, I’ve also passed by this computational data visualization project several times, admiring it, but not thinking much of it.

Like Joseph, I also found out that the project took into account real-time weather reports of cities all around the country which would be helpful particularly for people in the airport. 

After coding arrays the past weeks, I was able to make an observation that the projects that I see around me like eCloud in the San Jose airport is one that utilizes arrays of several compilations of data to create a visual that translates numbers into better communication methods for consumers like me.

Sarah Choi – Project – 09 – Computational Portrait

project-09

//Sarah Choi 
//Section D
//sychoi@andrew.cmu.edu
//Project-09

var underImage;

function preload() {
    var image = "https://i.imgur.com/YcBwEXw.jpg";
    underImage = loadImage(image);
}

function setup() {
    createCanvas(350, 400);
    underImage.resize(350, 400);
    background(0);
    underImage.loadPixels();
    frameRate(20);
}

function draw() {
    var px = random(width);
    var py = random(height);
    var xx = constrain(floor(px), 0, width-1);
    var xy = constrain(floor(py), 0, height-1);
    var colorXY = underImage.get(xx, xy);

    stroke(colorXY);
    strokeWeight(random(5, 20));
    noFill();
    ellipse(xx, xy, 20, 10);
}

function mouseDragged() {
    rect(mouseX, mouseY, random(5, 20), random (5, 40));
}

For my project, I chose a portrait of my father when he was living in New York, and we would go on father-daughter adventures. This was one of the most memorable days I had with him, which is why I wanted to depict my father through one computational project. Because of this, I loaded the pictures with ovals as shown in the original picture below, my father was always a huge fan of vintage oval-shaped sunglasses. On top of that, I wanted to use the drag function to use rectangular shapes to fill the canvas. It reminded me of the jazz music being played in the living room every Sunday morning.

Minjae Jeong-Looking Outwards-09

For this looking outwards post, I found Jenny Lee’s post on “eCLOUD”, created by artist Aaron Koblin. I think this interactive installation is interesting in a way that it replicates the shape and volume of a cloud real time. I agree with Jenny’s assessment on the cloud that the installation gives the audience chance to feel the different weather from different locations. I personally like this project more because it is installed at San Jose international airport, which makes the audience more relative to the project since they are in weather-sensitive situation. I also think this project has major potential in expanding the installation, by implementing weather elements that are important to travelers, like precipitation and wind.

Claire Yoon Project 9

sketch

//Claire Yoon
//claireyo@andrew.cmu.edu
//Section E
//Project—09—Portrait

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

function setup() {
    createCanvas(300, 400);
    background(0);
    baseImage.loadPixels();
    //rate at which the pixels appear
    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);
    // color at the current pixel
    var theColorAtLocationXY = baseImage.get(ix, iy);

    //draw ellipses at random sizes
    noStroke();
    fill(theColorAtLocationXY);
    //ellipses increase in size when mouse is pressed
    if (mouseIsPressed) {
        ellipse(px, py, random(10, 17), random(10, 17));
    //ellipses in more smaller sizes
    } else {
        ellipse(px, py, random(2, 10), random(2, 10));
    }
}

I enjoyed experimenting with the different sizes of the ellipses by randomizing the size and increasing the randomized size when clicking on the mouse.

Finished portait

Looking Outwards 09

Building hopes- a generative rock sculpture

For this Looking Outwards post, I found Yoshi’s looking outwards-0 5 post really intriguing. This project is called Building hopes by Giorgia Lupi at Accurat for Google and it is an experimental AR app that is powered by Google trends data to explore the user’s hopes. It is interesting how each rock , which is digitally generated, represents a topic and varies in size and color depending on the user’s desired intensity. Then they are stacked to create a physical representation of the user’s hopes. Like Yoshi, I admire how it is inspired by traditional balancing rock art and how she is available to use generative 3d art to humanize data trends rooted in tradition. Additionally I like how this project incorporates a sense of physicality to hopes which are intangible to enhance a more natural interaction. This project reminds us that there are so many more ways to interpret data.

Ar generated rock sculptures