Skip to content

Trim

Node icon
Transform

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

Trim detects the edges of an image and crops them away, leaving only the visible content plus an optional padding margin. Three modes are available: Transparent Pixels (default) trims pixels based on alpha transparency, Top-Left Color trims pixels matching the top-left corner’s color, and Bottom-Right Color trims pixels matching the bottom-right corner’s color. A Threshold slider controls how close a pixel’s color must be to count as a match.

This is typically used early in a pipeline to normalize sizing before applying effects, ensuring every frame starts from a tight crop.

Pins

ImageImage
InputRequired
ImageImage
Output

Transform

ModeChoice
Default: Transparent Pixels

Transparent Pixels: trim based on alpha channel. Top-Left/Bottom-Right Color

  • 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

Mode 0: alpha threshold for detecting content. Modes 1-2: color distance tolerance for matching

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

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

  • Use Trim right after Image In to remove extra transparent space from source assets.
  • Add a few pixels of padding to keep a safety margin around the content.
  • A Threshold of 0 keeps any pixel with alpha > 0; raise it to also trim nearly-invisible pixels.
  • Use Top-Left Color or Bottom-Right Color mode to trim solid-color backgrounds (e.g., white or black borders) from images without transparency.