Mask

Mask or crop images and shapes using stencil regions.

What it does

Mask cuts down content two ways. With the Mask input disconnected it is a rectangle crop, with insets from each edge. Wire an image, a shape, a mesh or a Volume into Mask and it becomes a stencil: only the parts of the content falling inside the mask survive.

Each kind of content is masked in its own terms. Images get a GPU stencil or crop. A shape masked by a shape stays a shape, a clean boolean intersection with no rasterising and no loss of crispness at any zoom; only mixed content, a shape masked by an image or the reverse, is rasterised. Meshes masked by meshes get a real 3D boolean. Volumes get a per-voxel density multiply, and points are culled in or out by where they land inside a Volume mask.

When to use it

ParameterTypeDefaultWhat it does
content_inColor Field or Collection or Volume—Content to mask or crop (Raster, Shapes, Mesh, Points, or Volume)
maskColor Field or Scalar Field or Vector Field or Collection—Mask shape, mesh, texture, or volume (leave disconnected for rectangle crop)
leftAny0Crop from left edge. Bind From Attribute, or wire a NumberArray (per-row insets) or an easing curve (inset profile over the rows); the slider is then the fallback/offset.
topAny0Crop from top edge. Bind From Attribute, or wire a NumberArray (per-row insets) or an easing curve (inset profile over the rows); the slider is then the fallback/offset.
rightAny0Crop from right edge. Bind From Attribute, or wire a NumberArray (per-row insets) or an easing curve (inset profile over the rows); the slider is then the fallback/offset.
bottomAny0Crop from bottom edge. Bind From Attribute, or wire a NumberArray (per-row insets) or an easing curve (inset profile over the rows); the slider is then the fallback/offset.
unitsString"Pixels"Unit for crop values. One of: Pixels, Percent.
centerBooleanfalseCenter the visible crop region in the output frame
channelString"Alpha"Which channel of the mask to use as stencil. One of: Alpha, Luminance.
mask_channelString""For a multi-channel field mask (a captured record): which named Color channel to use.
invertBooleanfalseInvert mask or crop region
softnessNumber0Feather the mask/crop edge (pixels)
mixNumber1Blend between original and masked (0 = passthrough)
strengthNumber1Effect strength / wet-dry (0 = no effect, 1 = full). Editable, wirable, keyframable.

Gotchas

Cropping a shape with no mask wired trims relative to the shape's own bounding box, not the canvas, so a small inset trims a small shape correctly wherever it sits.

An image wired as the mask becomes the frame: the output takes the mask's size and placement, and the content is repositioned to sit inside it. With nothing wired, the content keeps its own frame and the crop rectangle is measured against it instead.

Worked example

  1. Add a Mask node and wire an image into Content.

  2. Leave Mask disconnected and set Left/Top/Right/Bottom to crop a rectangle out of the image.

  3. Wire a second image (or a shape) into Mask. The crop controls give way to a stencil cut using that mask's Alpha or Luminance channel.

  4. Raise Softness to feather the cut edge, and use Invert to flip which side is kept.

  5. Pull Mix down from 1 toward 0 to blend back toward the unmasked original.

See also

Fill · Trim Path · Transform · Rasters (images)