Skip to content

Mask Refine

Node icon
Mask

Refines a mask with erode, dilate, feather, threshold, and morphological operations.

A crisp mask of river pebbles beside the same mask through Mask Refine, every stone grown outward and its edge feathered soft

Mask Refine is the main tool for cleaning up masks. It works in order: optional Threshold binarizes, Erode / Dilate shrinks (positive) or grows (negative) the white region, a Morphology operation cleans up, and Feather softens the edges.

With an image connected, Extend Transparent RGB fills the color under fully transparent pixels with nearby edge color. That matters for straight-alpha texture export, external mip generation, and any tool that reads a transparent pixel’s RGB: without it, black (or whatever was there) bleeds into your artwork’s edges.

Radius sets how far the fill reaches; if a Dilate or Morphology setting needs more, the larger reach is used. The option starts off.

Pins

ImageImage
InputOptional
MaskMask
InputOptional
ImageImage
Output
MaskMask
Output

Mask

ThresholdToggle
Default: false

Enable to binarize the mask before refinement. Disable to preserve soft gradients

Threshold ValueInteger
Default: 128 Range: 0–255
When Threshold is on

Binarization cutoff applied before erosion. Pixels >= threshold become white

Erode / DilateNumber · px/%
Default: 0.0 Range: -50.0–50.0 px / -100–100%

Positive: erode (shrink white region). Negative: dilate (expand white region)

FeatherNumber · px/%
Default: 1.5 Range: 0.0–50.0 px / 0–100%

Gaussian blur radius on mask edges. Set to 0 for hard edges (pixel art)

InvertToggle
Default: false

Invert the mask: white becomes black and vice versa

Mask FromChoice
Default: Luminance
Color image connected to the mask input

How the connected color image is read as a mask

  • LuminanceRead the image's brightness as the mask. The default.
  • AlphaRead the image's transparency as the mask.
  • RedUse the red channel as the mask.
  • GreenUse the green channel as the mask.
  • BlueUse the blue channel as the mask.

Morphology

OperationChoice
Default: None

Extra cleanup applied after Erode / Dilate

  • NoneNo morphological operation, so only erode, feather, and threshold apply.
  • OpenErode then dilate, removing small noise and thin protrusions while preserving overall shape.
  • CloseDilate then erode, filling small holes and gaps while preserving overall shape.
  • GradientDifference between dilation and erosion, extracting the edge/outline of the mask.
  • Top HatDifference between input and opening, isolating bright details smaller than the kernel.
  • Black HatDifference between closing and input, isolating dark details smaller than the kernel.
Kernel ShapeChoice
Default: Ellipse
When Operation != None

Shape of the kernel the operation uses

  • RectangleSquare structuring element that affects pixels in a rectangular area.
  • EllipseCircular structuring element for the most natural-looking morphological operations.
  • CrossCross-shaped structuring element that affects only pixels along horizontal and vertical axes.
Kernel Size (px)Integer
Default: 3 Range: 1–100
When Operation != None

Kernel radius in pixels

IterationsInteger
Default: 1 Range: 1–10
When Operation != None

How many times the operation repeats. Raise it for a stronger result without changing Kernel Size

Transparent RGB

Extend Transparent RGBToggle
Default: false
Image input connected

Stores edge color beneath fully transparent pixels, for straight-alpha texture export, external mip generation, and downstream tools that read transparent RGB.

ArcBrush's own Resize and Transform already resample premultiplied and do not need this.

Radius (px)Integer
Default: 16 Range: 1–128
Image input connected and Extend Transparent RGB on

Minimum extension radius. Automatic alpha-expanding operations may extend further

  • A small erode (1 to 2 px) removes fringe pixels at mask edges.
  • Use Open to clean up noisy masks and Close to patch small holes, both without changing the overall shape.