Try Pro FREE for 2 weeksGet Started

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

  • mask-editing
  • dilate
  • erode
  • morphology
  • edge-refinement

Alternatives in Image Masking

All AI models