xxxxxxxxxx
37
let vincent;
function preload() {
vincent = loadImage('vincent.jpg');
}
function setup() {
createCanvas(1280, 1014);
//background(220);
//image(vincent, 0, 0);
}
function draw() {
vincent.loadPixels();
//console.log(vincent.width);
loadPixels();
for (let i = 0; i < vincent.width; i++) {
for (let j = 0; j < vincent.height; j++) {
console.log('Hey!');
let index = 4*(i + j * width);
let r = vincent.pixels[index];
let g = vincent.pixels[index + 1];
let b = vincent.pixels[index + 2];
console.log(r);
pixels[index] = r;
pixels[index + 1] = g;
pixels[index + 2] = b;
}
}
updatePixels();
}