# Removing PImage mask

**URL:** <https://discourse.processing.org/t/removing-pimage-mask/28620>\
**Category:** Coding Questions\
**Created:** [March 17, 2021, 8:08pm UTC](https://discourse.processing.org/t/removing-pimage-mask/28620 "2021-03-17T20:08:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean-no](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jean-no/32/3352_2.png) [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Post date:** [March 17, 2021, 8:08pm UTC](https://discourse.processing.org/t/removing-pimage-mask/28620/1 "2021-03-17T20:08:24Z")

</div>

Hi !  
I wonder if there is a way to remove the alpha mask of a PImage (applied with the PImage.mask() command) or if I just have to apply an int array full of 255…

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [March 17, 2021, 8:18pm UTC](https://discourse.processing.org/t/removing-pimage-mask/28620/2 "2021-03-17T20:18:27Z")

</div>

I guess so. Or you can hack it by using blendMode REPLACE  
[https://processing.org/reference/blendMode\_.html](https://processing.org/reference/blendMode_.html)

---

<div class="post-metadata">

**Author:** ![Jean-no](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jean-no/32/3352_2.png) [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Post date:** [March 17, 2021, 10:33pm UTC](https://discourse.processing.org/t/removing-pimage-mask/28620/3 "2021-03-17T22:33:03Z")

</div>

I ended up with this… Actually it’s quite fast.  
Its called with : noMask(myPImage);

```auto
void noMask(PImage i) { 
  int[] masque= new int[i.width*i.height];
  for (int a=0; a<masque.length; a++) {
    masque[a]=255;
  }
  i.mask(masque);
}

```
