# Masking .mp4 question

**URL:** https://discourse.processing.org/t/masking-mp4-question/19822
**Category:** Libraries
**Created:** [April 16, 2020, 3:53am UTC](https://discourse.processing.org/t/masking-mp4-question/19822 "2020-04-16T03:53:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sco66](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sco66](https://discourse.processing.org/u/sco66)
#### Post date: [April 16, 2020, 3:53am UTC](https://discourse.processing.org/t/masking-mp4-question/19822/1 "2020-04-16T03:53:30Z")

</div>

Hi forum,

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

```auto
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.

---

<div class="post-metadata">

### Author: ![sco66](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sco66](https://discourse.processing.org/u/sco66)
#### Post date: [April 16, 2020, 7:44am UTC](https://discourse.processing.org/t/masking-mp4-question/19822/2 "2020-04-16T07:44:00Z")

</div>

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.
