xxxxxxxxxx
let img;
// Loading the image file is usually done with the preload() function.
// This function makes sure that the file is loaded before it goes to setup() and draw()
function preload(){
img = loadImage("shroom.png");
}
function setup() {
createCanvas(512, 512);
}
function draw() {
background(0);
tint(255);
image(img,0,0,width,height);
tint(255,100);
image(img,mouseX,mouseY,256,256);
}