xxxxxxxxxx
28
let myImage;
let cat;
function preload(){
cat = loadImage('cat.jpg')
}
function setup() {
createCanvas(cat.width, cat.height);
pixelDensity(1);
myImage = createImage(width,height)
}
function draw() {
cat.loadPixels();
myImage.loadPixels();
line()
for (let i = (480*4); i < myImage.pixels.length; i ++) {
myImage.pixels[i] = cat.pixels[i];
//myImage.pixels[i] = cat.pixels[i];
// myImage.pixels[i + 1] = 0;
// myImage.pixels[i + 2] = 0;
// myImage.pixels[i + 3] = 255;
}
myImage.updatePixels();
image(myImage,0,0)
}