/* Rachel Lee
Section E
rwlee@gmail.com
Project 09: Custom Pixel*/
var pic;
// preloads image
function preload() {
pic = loadImage("https://i.imgur.com/iuFu4yy.jpg");
}
function setup() {
createCanvas(358, 480);
pic.loadPixels();
background(255);
imageMode(CENTER);
frameRate(100);
}
function draw() {
// randomizes position of pixel appearance
var x = constrain(floor(random(width)), 0, width - 1);
var y = constrain(floor(random(height)), 0, height - 1);
// randomizes arc width and height
var w = random(5, 30);
var h = random(5, 30);
noStroke();
// picks colors from pixel position
var picCol = pic.get(x, y);
fill(picCol);
// draws arcs as 'custom pixel'
arc(x, y, w, h, HALF_PI, PI);
}
I decided to create a custom pixel portrait of my dad for his birthday this weekend. Due to its personal significance, I found this project to be super fun and rewarding, and hope he enjoys the project! I will be doing more of these in the future to try out different options.
![](wp-content/uploads/2018/10/91C3655-224x300.jpg)
![](wp-content/uploads/2018/10/Screen-Shot-2018-10-25-at-7.43.59-PM-223x300.png)
![](wp-content/uploads/2018/10/Screen-Shot-2018-10-25-at-7.47.41-PM-223x300.png)