Skip to content

Trim

Node icon
Transform

Auto-crops transparent edges from an image, tightening the bounding box around visible content.

A gramophone rendered in a large transparent frame, the checkerboard filling the tile, beside the same render after Trim at the same scale: the canvas cut tight to the gramophone's edges, a much smaller checkerboard with no empty margin

Trim crops away the empty border around an image’s content, leaving the content plus an optional padding margin. By default it treats transparent pixels as empty; the two corner-color modes instead trim pixels matching the top-left or bottom-right corner, which handles solid white or black borders on images without transparency. Use it early in a pipeline so every frame starts from a tight crop before effects are applied.

Trim accepts a whole texture set. The rectangle is measured from the set’s Opacity and from nothing else, then applied to every map, so a Base Color that happens to be opaque everywhere, or a corner color that matches the interior, cannot move it. All three detection modes read that one plane, which is why over a set they are named Transparent Pixels, Top-Left Opacity, and Bottom-Right Opacity. The Normal is unchanged. A library is trimmed set by set, each to its own Opacity.

Pins

ImagePixels or Texture
InputRequired
ImagePixels or Texture
Output

Trim

ModeChoice
Default: Transparent Pixels

A texture set is always trimmed by its Opacity, so every map keeps the same rectangle

  • Transparent PixelsTrim based on the alpha channel. Removes rows and columns of fully transparent pixels from each edge.
  • Top-Left ColorTrim pixels matching the top-left corner color within the tolerance. Useful for removing solid-color borders.
  • Bottom-Right ColorTrim pixels matching the bottom-right corner color within the tolerance. Use when the border color differs from the top-left.
ThresholdInteger
Default: 30 Range: 0–255

Cutoff between content and background.

  • Transparent Pixels: pixels with alpha above this are content. 0 = any visible pixel.
  • Top-Left Color / Bottom-Right Color: how far a color may be from the corner color and still be trimmed. 0 = exact match only.

On a texture set it is read against the set's Opacity, which runs 0 to 1.

Padding (px)Integer
Default: 0 Range: 0–500

Extra pixels to keep around the trimmed content. Added equally on all sides

  • Put Trim right after Image In to remove extra transparent space from source assets, and add a few pixels of Padding as a safety margin.
  • Threshold defaults to 30, so faint pixels (alpha 30 or below) are trimmed along with fully transparent ones. Set it to 0 to keep every visible pixel, such as a soft shadow’s outer edge.