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
Cropping an image or shape to a rectangle: leave Mask disconnected and set the edge insets.
Cutting one shape or image out using another shape as a stencil.
Revealing part of an image through another image's alpha or brightness as a matte.
Keeping only the points that fall inside a volume region.
A soft, feathered cut edge instead of a hard line: raise Softness.
| Parameter | Type | Default |
|---|---|---|
content_in | OneOf([FieldOf(Color), Collection, FieldOf(Volume)]) | — |
mask | OneOf([FieldOf(Color), FieldOf(Scalar), FieldOf(Vector), Collection]) | — |
left | Any | 0 |
top | Any | 0 |
right | Any | 0 |
bottom | Any | 0 |
units | String | "Pixels" |
center | Boolean | false |
channel | String | "Alpha" |
mask_channel | String | "" |
invert | Boolean | false |
softness | Number | 0 |
mix | Number | 1 |
strength | Number | 1 |
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
Add a Mask node and wire an image into Content.
Leave Mask disconnected and set Left/Top/Right/Bottom to crop a rectangle out of the image.
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.
Raise Softness to feather the cut edge, and use Invert to flip which side is kept.
Pull Mix down from 1 toward 0 to blend back toward the unmasked original.