# Reveal Image of the Masking

**URL:** <https://discourse.processing.org/t/reveal-image-of-the-masking/39215>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [October 11, 2022, 1:17pm UTC](https://discourse.processing.org/t/reveal-image-of-the-masking/39215 "2022-10-11T13:17:32Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [October 11, 2022, 4:28pm UTC](https://discourse.processing.org/t/reveal-image-of-the-masking/39215/6 "2022-10-11T16:28:29Z")

</div>

Hi @Judy,.

There are several ways to do what you want …

Made also a masking example for another topic…

> [@Painting/revealing a layer](https://discourse.processing.org/t/painting-revealing-a-layer/38000/2):
>
> Hi @bringmeflowers, better use [the mask function](https://processing.org/reference/PImage_mask_.html) for this … check out… PGraphics maskimg; PImage underlyingimg; void setup() { size(800,800,P2D); underlyingimg = loadImage("image.jpg"); // create mask (should be same as the underlying image size) maskimg = createGraphics(underlyingimg.width,underlyingimg.height,P2D); // initialize the whole mask with black (everything hidden) maskimg.beginDraw(); maskimg.background(0); maskimg.noStroke(); maskimg.fill(255); maskimg.endDr…

Try both a mask and a pixel version. It’s fun and a good exercise. 🤓

Cheers  
— mnse

---

_[View the full topic](https://discourse.processing.org/t/reveal-image-of-the-masking/39215)._
