# How to create a clipping mask that preserves transparency?

**URL:** <https://discourse.processing.org/t/how-to-create-a-clipping-mask-that-preserves-transparency/16093>\
**Category:** Project Guidance\
**Created:** [December 4, 2019, 12:51am UTC](https://discourse.processing.org/t/how-to-create-a-clipping-mask-that-preserves-transparency/16093 "2019-12-04T00:51:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![aNew](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@aNew](https://discourse.processing.org/u/aNew)\
**Post date:** [December 6, 2019, 11:24pm UTC](https://discourse.processing.org/t/how-to-create-a-clipping-mask-that-preserves-transparency/16093/4 "2019-12-06T23:24:16Z")

</div>

Nice, that’s a really good approach! More condensed too. I can see the two approaches being used for slightly different purposes, as they handle semi-transparent values differently. Like, if a pixel with an alpha value of 128 was masked by a value of 128, they have different results. alphaSubtract() would push the value to 0, while minAlphas() would keep it at 128. Either works fine for what I’m doing now.

---

_[View the full topic](https://discourse.processing.org/t/how-to-create-a-clipping-mask-that-preserves-transparency/16093)._
