xxxxxxxxxx
24
let img, sorted_img;
function preload() {
img = loadImage("cat-800x600.jpg")
}
function setup() {
createCanvas(1600, 600)
console.log(img)
sorted_img = createImage(img.width, img.height, RGB);
sorted_img.loadPixels()
for (let i = 0; i < sorted_img.pixels.length; i++) {
console.log(i)
sorted_img.pixels[i] = color(random(255))
}
sorted_img.updatePixels()
}
function draw() {
background(220)
image(img, 0, 0)
image(sorted_img, 800, 0)
}