Masking .mp4 question

Hi forum,

I have a question about masking a .mp4. Masking seems to work excellently with PImage:

PImage imgMask;

void setup() {
  size(640, 360);
  img = loadImage("moonwalk.jpg");
  imgMask = loadImage("moonwalk.jpg");
  img.mask(imgMask);

}

void draw() {
  background(180, 102, 253);


  image(img, 0, 0);
  
    fill(12,0,144);
  ellipse(60,60,60,60);
}

The above code sets the blacks in the image to transparent - all good.

When I try to do this with a .mp4 it works - up to a point. I get some flickering in the image. This might be a misuse of the mask function - does it work in this way with an .mp4? Happy to show the code for this if necessary.
Thanks,
Scott.

1 Like

Hi,
ok managed to solve by using a PGraphics - works well. The mask function does work in this case (if anyone needs to know).

Scott.

1 Like