image-mask-grow — Masking AI Model
Mask Grow / Shrink moves the edge of a binary mask outward or inward by a set number of pixels. Masks are all-or-nothing, but real edges — hair, wool, fur — blend over a few pixels, and a segmenter usually puts its one hard line slightly inside the subject. Growing the mask a little takes those pixels back, so a cutout keeps its own edge instead of handing it to whatever runs next. Shrinking does the opposite, for when a mask spills past the object. Elliptical kernel, so corners move the same distance as flat edges. CPU, instant.
Details
- CategoryMasking
- Year-1
- License
Inputs & Outputs
- MaskInputimage
Binary mask to adjust (white = selected)
- MaskOutputimage
Mask with its edge moved by the given number of pixels
Parameters
- amountintegerdefault 4range -64–64
Pixels to grow (+) or shrink (-)
How far to move the mask edge, in pixels of the input. Positive grows the selected area, negative shrinks it, 0 leaves it where it is. Default 4 — enough to recover a fabric or hair edge a segmenter cut short. Large values round off fine detail, so raise it only while the result still looks like the object.
Tags
Alternatives in Image Masking
- Image Masker by Class
Build a B&W mask from segmentation/detection by class name.
- Image Masker by Coord
Build a B&W mask from explicit bbox coordinates.
- Image Masker by Region
Build a B&W mask from line-separated polygons or bounding boxes.
- Manuel Image Masker
Hand-draw a B&W mask with brush tools.
- Object Picker
Interactive — click segmented objects to build a mask.