sketch
//Evette LaComb
//Section D
//09 project
//the portrait must be an un-retouched photograph of a person
//that can be acessed on imgur.com
//you can only display the portrait generated
//should not be bigger than 480 x 480
//show creativity
//write a sentance or tow reflecting on your process and product
let img;
var x;
var y;
var angle = 0;
var radius = 0;
var frameCount = 0;
var circleSize = 1;
function preload() {
img = loadImage("https://i.imgur.com/a9JqjIf.jpg");
}
function setup() {
createCanvas(480, 480);
img.loadPixels();
imageMode(CENTER);
img.resize(480, 480)
background("grey");
noStroke();
}
function draw() {
//varaibles for x and y occording to spiral
x = radius * cos(radians(angle));
y = radius * sin(radians(angle));
//code for calling pixels:
var pix = img.get(x, y);
var pixx = img.get(width/2, y);
//code for the circels and fill:
fill(pix);
circle(x, y, circleSize);
fill(pixx);
circle(x, y, circleSize/2);
//code for the spiral:
radius += frameCount / 3000;
angle += 8;
frameCount += 1;
circleSize += 0.07;
if (frameCount > 3000) {
noLoop();
}
//border to cover where circles could not be drawn:
fill("white");
rect(0, 0, width, 20);
rect(0, height - 20, width, height - 20);
rect(0, 0, 20, height);
rect(height - 20,0, height, width- 20);
}
//my process for this was I wanted to include a spiral effect revealing the image
//I found that translating th spiral to the center effted where my pixel colors were being grabbed from
//I changed the spiral instead to start at 0, 0
//I ended up liking this effect better because it shows how the that top corner
//is the brightest part. The spiral created a sun ray effect that looked cool
//I then wanted something else in the circled so I made donuts with the
//inverted color in the center. This helped to bring some color to the top corner
//so it wasnt just all white.