Editor Demo:
https://bubble.io/page?id=blur-apps-playground&test_plugin=1773673697028x546347613118529540_current&tab=Design&name=test-face-mesh-mask&type=page
What You Can Do
- Upload any photo with a face and instantly get back a
black-and-white mask image highlighting the exact facial
features you choose
- Mask one region or multiple at once (e.g. both eyes +
lips in a single call)
- Get the mask as a stored file in your Bubble app or as
an inline image
- Works with any face photo — selfies, portraits, profile
pictures
---
Setup
1. Add the Face Mesh element to your page
- Set its Image Source to the user's photo (upload,
camera capture, or database image)
2. Add GenerateMaskOnly to your workflow
Landmarks JSON
FaceMeshElement's landmarks_json
Polygon JSON
The face regions you want to mask (see Region Codes
below)
Mask Width / Height
Size of the output mask image (default 512x512)
Upload to Storage
Yes to save to your app's files, No for inline image
Website Home URL
Required if uploading — set to Website Home URL
3. Use the result
- Mask Image gives you the mask — display it, save it to
your database, or send it to an external API
---
Region Codes
Copy and paste the regions you need into the Polygon JSON
field. Combine as many as you want in a single array.
Left eye
[33, 7, 163, 144, 145, 153, 154, 155, 133, 173, 157, 158,
159, 160, 161, 246]
Right eye
[362, 382, 381, 380, 374, 373, 390, 249, 263, 466, 388,
387, 386, 385, 384, 398]
Lips
[61, 146, 91, 181, 84, 17, 314, 405, 321, 375, 291, 409,
270, 269, 267, 0, 37, 39, 40, 185]
Face oval
[10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361,
288, 397, 365, 379, 378, 400, 377, 152, 148, 176, 149,
150, 136, 172, 58, 132, 93, 234, 127, 162, 21, 54, 103,
67, 109]
Example — mask both eyes:
[[33,7,163,144,145,153,154,155,133,173,157,158,159,160,16
1,246],[362,382,381,380,374,373,390,249,263,466,388,387,3
86,385,384,398]]
---
Use Cases
- Beauty apps — isolate lips or eyes for virtual try-on
of makeup colors
- Avatar editors — extract face shape for custom avatar
generation
- Photo editors — apply effects to specific facial
features only
- Identity verification — mask everything except the face
oval
- AR filters — generate masks to position overlays on
exact face regions