# Using pixels array to fill shape

**URL:** <https://discourse.processing.org/t/using-pixels-array-to-fill-shape/23526>\
**Category:** Coding Questions\
**Created:** [August 27, 2020, 4:57pm UTC](https://discourse.processing.org/t/using-pixels-array-to-fill-shape/23526 "2020-08-27T16:57:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![AuXie2k9](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/auxie2k9/32/9907_2.png) [@AuXie2k9](https://discourse.processing.org/u/AuXie2k9)\
**Post date:** [August 29, 2020, 6:48am UTC](https://discourse.processing.org/t/using-pixels-array-to-fill-shape/23526/2 "2020-08-29T06:48:40Z")

</div>

I believe a much more intuitive and easy way would be to use a mask.  
Create a pgraphics where you will draw your ellipses (with or without arrays).  
Use this as a mask for vid1.  
Here’s another thread on how to use a mask with video.

> [@Video within a shape (or alpha mask)](https://discourse.processing.org/t/video-within-a-shape-or-alpha-mask/663):
>
> Hello everyone!, I´m rather new into processing, but I have experience coding. I want to put the video streaming withing a an irregular shape (it doesn´t have to be a rectangle). My approach, I did a b&w mask image with the same proportions of the windows. The white part of the mask is where I want to put the video pixels. So these are the steps. I get pixels from the video streaming I scan the mask by row and columns, and if this locations corresponds to a white pixel, I put the pixel o…

---

_[View the full topic](https://discourse.processing.org/t/using-pixels-array-to-fill-shape/23526)._
