Project-09-Portrait

I chose to do a portrait of myself when I was little. I chose to use symbols that represent the astrology of my birthday. I did my zodiac sign which is Virgo, and I did what the moon looked like on my birthday (Sep 10 2001), a waning gibbous. When you press the up arrow the symbols get larger, and if you press the down arrow they get smaller. Additionally, if you click then there will be a blur filter applied to the image.

graanak-09
//Graana Khan 
//Section B
//Custom Pixels

var img;

//my zodiac sign is a Virgo and the moon was a waning gibbous on my birthday Sep 10 2001
let skyView = ['♍︎', '🌔︎']; 


function preload(){
	img = loadImage("https://i.imgur.com/VuQGYhY.jpg");
}

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

    //setting the image in the center and resizing it to the canvas size
    imageMode(CENTER);
    img.loadPixels();
    img.resize(480,480);
    frameRate(20000);

    //orange backdrop
    background(252, 226, 119);
}

function draw() {

	//getting pixel colors and location
	let x = floor(random(img.width));
	let y = floor(random(img.height));
	let pix = img.get(x, y);
	//setting the color to be the pixel locations of the image
	fill(pix);

	// up arrow makes the symbols larger, down arrow makes them smaller
	if(keyIsDown(UP_ARROW)){
		textSize(random(10, 15));
	}else if(keyIsDown(DOWN_ARROW)){
		textSize(random(3, 5));
	}else{
		textSize(8);
	}

	text(random(skyView), x, y);

}

//this blurs the image further everytime the mouse is pressed
function mousePressed(){
	filter(BLUR, 1);
}

Initial generation.
Almost fully generated without blur.
Generated with blur added.
The original photo.

Leave a Reply