PImage img1, img2; PImage msk1; PImage icn1; void setup() { size(400,300); background(0); img1 = loadImage("img01.jpg"); img2 = loadImage("img02.jpg"); msk1 = createImage(img1.width,img1.height,ARGB); icn1 = loadImage("icn01.jpg"); } void draw() { image(img1,0,0); img2.mask(msk1); img2.updatePixels(); image(img2,0,0); } void mouseDragged() { int left = mouseX-icn1.width/2; int top = mouseY-icn1.height/2; left = constrain(left,0,img1.width-icn1.width); top = constrain(top,0,img1.height-icn1.height); msk1.blend(icn1,0,0,icn1.width,icn1.height, left,top,icn1.width,icn1.height,LIGHTEST); msk1.updatePixels(); }