//Jacky Lococo
//jlococo
//Section C
var photoFace; //stores the image
var size =10 //stores size of the images
functionpreload(){
photoFace =loadImage('https://i.imgur.com/vdN43xy.png?1');}functionsetup(){createCanvas(345,400);imageMode(CENTER);noStroke();
photoFace.loadPixels();}functiondraw(){background(255);drawPixleate();fill(0);textSize(15)text('P R E S S', mouseX, mouseY); // writes press
size =map(mouseX,0, width,10,50); // will map the size of the
if(size ==0) size =1;}functiondrawPixleate(){for(var y =5; y < height +50; y += size){for(var x =5; x < width +50; x += size){print(photoFace.width);var pix = photoFace.get(x, y); //extracts color from the image
fill(pix);if(mouseIsPressed){ellipse(x, y, size, size); //ellipse instead of rectangles when mouse is pressed
}else{rect(x, y, size, size);//rectangled when mouse is not pressed
}}}}