xxxxxxxxxx
57
let img;
let s;
let t;
let x;
let y;
function preload() {
img = loadImage('test.png');
}
function setup() {
createCanvas(400, 400);
pixelDensity(1);
image(img, 0, 0);
}
function draw() {
}
// function mouseClicked() {
// t = random(uncollected);
// x1 = t[0];
// y1 = t[1];
// //pull out pixel info, download pixel as img file
// p = get(x1, y1,1,1)
// save(p, 'pixel.png')
// loadPixels();
// //update the pixel in pixel array
// let index = (x1 + y1 * width) * 4;
// pixel[index] = 0;
// pixel[index + 1] = 0;
// pixel[index + 2] = 0;
// pixel[index + 3] = 0;
// // remove (x,y) from uncollected
// let a = uncolllected.indexOf(t)
// uncollected.splice(a, a + 1)
// updatePixels()
// }