xxxxxxxxxx
64
let img1;
let img2;
let img3;
let one;
let two;
let a;
function preload() {
img1 = loadImage("image1.jpg");
img2 = loadImage("image2.jpg");
img3 = loadImage("image3.jpg");
}
function setup() {
createCanvas(200, 200);
pixelDensity(1);
}
function draw() {
background(0);
//let two = image(img2, 0, 0, width, height)
push()
let one = image(img1, 0, 0, width, height)
// loadPixels()
loadPixels()
// pixels[4%] = 0
for (let x = 0; x < width; x = x + 3) {
for (let y = 0; y < height; y++) {
let i = (width * y + x) * 4;
pixels[i + 3] = 0
}
}
updatePixels()
pop()
// let two = image(img2, 0, 0, width, height)
// //two.loadPixels()
// loadPixels()
// for (let x = 0; x < width; x = x + 3) {
// for (let y = 0; y < height; y++) {
// let i = (width * y + x) * 4;
// two.pixels[i + 3] = 0;
// }
// }
// for (let x = 1; x < width; x = x + 3) {
// for (let y = 0; y < height; y++) {
// let i = (width * y + x) * 4;
// img2.pixels[i + 3] = 50;
// }
// }
//updatePixels()
updatePixels()
}