# Questions about image.b\_and(image\[, mask=None\])

**URL:** <https://forums.openmv.io/t/questions-about-image-b-and-image-mask-none/6082>\
**Category:** OpenMV Boards\
**Created:** [July 8, 2021, 11:37am UTC](https://forums.openmv.io/t/questions-about-image-b-and-image-mask-none/6082 "2021-07-08T11:37:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eekave98](https://avatars.discourse-cdn.com/v4/letter/e/2acd7d/32.png) [@eekave98](https://forums.openmv.io/u/eekave98)\
**Post date:** [July 8, 2021, 11:37am UTC](https://forums.openmv.io/t/questions-about-image-b-and-image-mask-none/6082/1 "2021-07-08T11:37:20Z")

</div>

Hi,

Is there a way to use mask so that it would be in frame buffer? I am wondering would it be faster way to do mask function?

I did found that if the mask is in flash drive then it works like this:

img2 = sensor.snapshot().b\_and(“mask\_test.bmp”)

if i have in img sensor snapshot which i have modified so that all it’s bits are black or white  
img.set\_pixel(x, y, (0, 0, 0))  
img.set\_pixel(x, y, (255, 255, 255))

i cannot use this img as mask. So is there a way?

-Kari

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [July 8, 2021, 7:50pm UTC](https://forums.openmv.io/t/questions-about-image-b-and-image-mask-none/6082/2 "2021-07-08T19:50:45Z")

</div>

See sensor.alloc\_extra\_fb(). Let’s you create a second frame buffer.
