Filter node

Crop Image

Crops an image to what matters and outputs a SMALL texture. Manual mode cuts a Grafit-unit rectangle; Crop Alpha finds the alpha bounding box on the GPU — render a tiny object on the full viewport, crop it here, and a Particle System gets a sprite-sized texture instead of the whole render view. Scale downsamples on top; Padding protects soft edges. Grow Only (default) makes the rect a running UNION — after one animation cycle it is measured and NEVER moves again, absolutely stable. Center reports where the content was.

Inputs

PortTypeDefault
ImageThe texture to crop — any generator or Canvas output. The source keeps rendering even off-canvas while this node is enabled.image—
EnableOff stops cropping and clears the output. The measured rect is kept, so re-enabling continues calmly.booltrue
ModeManual cuts a fixed Grafit-unit rectangle (X/Y/Width/Height). Crop Alpha is the smart one: the GPU finds the alpha bounding box and the output shrinks to just the visible content — a tiny object rendered on the full viewport becomes a sprite-sized texture.int1
XManual: crop rectangle center X in Grafit units (0 = screen center).float0
YManual: crop rectangle center Y in Grafit units.float0
WidthManual: crop rectangle width in Grafit units (viewport short edge = 2).float1
HeightManual: crop rectangle height in Grafit units.float1
ThresholdCrop Alpha: how much alpha counts as content (default 0.01). Raise it to ignore faint glow tails and crop tighter; lower to keep every soft edge.float0.01
PaddingCrop Alpha: margin in Grafit units kept around the alpha bounds (default 0.03) — protects soft/AA edges and absorbs the one-frame measurement latency on moving content.float0.03
ScaleDownsamples the cropped result (0.05–1). 1 = source resolution. The full optimization: crop away the empty viewport, then shrink what's left before feeding a Particle System sprite.float1
StabilityTracking mode only (Grow Only off): seconds the rect takes to SHRINK (growing is instant). 0 = track tightly, higher = calmer. Size changes are 8-px quantized so textures aren't reallocated every frame.float0.3
Grow OnlyABSOLUTE stability (default on): the rect is a running UNION — it only ever grows. A looping animation is fully measured after one cycle and the rect NEVER moves again: zero strobing by design. Toggle off and on to re-measure after content shrinks or relocates.booltrue
QuantizeOn (default): output sizes step in 8-px increments so a drifting rect doesn't reallocate the texture every frame. Off: exact-size output — for when pixel-exact dimensions matter more than reallocation calm.booltrue

Outputs

PortType
ImageThe texture to crop — any generator or Canvas output. The source keeps rendering even off-canvas while this node is enabled.image
WidthManual: crop rectangle width in Grafit units (viewport short edge = 2).float
HeightManual: crop rectangle height in Grafit units.float
Centerstructure

How It Works

Crop Image cuts an image down to what matters and outputs a small texture. That size change is the point: a small object rendered on a full-viewport texture used to cost a Particle System the whole render view when consumed as a sprite.

Manual mode cuts a rectangle in Grafit units. Crop Alpha finds the content's alpha bounding box on the GPU and shrinks the output to fit; Scale downsamples on top of that.

The rest of the controls exist because the node is built for animation. Padding protects soft and glowing edges. Threshold decides how much alpha counts as content. Sizes are 8-pixel quantized so a moving shape cannot strobe the texture size. Empty frames hold the last rectangle, so a blink does not collapse the sprite. And Grow Only (on by default) makes the rectangle a running union of everything the alpha has ever covered: a looping animation is fully measured after one cycle, and the frame then never moves again.

Center, Width and Height report where the content was and how big it really is, so a downstream node can put it back exactly where it came from.

Use Cases

  • Make a sprite — Render a shape on the full viewport, crop it here, and hand a sprite-sized texture to a Particle System or a Replicator.
  • Trim a generator — Cut a text or a logo down to its ink before compositing.
  • Stabilise an animated element — Grow Only measures the whole loop once and then holds the frame perfectly still.
  • Re-place the content — Center plus Get Image Size lets a Canvas put the cropped element back at its original position and scale.
  • Save texture memory — Any chain that carries a mostly-empty full-viewport texture gets cheaper here.

Tips

  • Leave Grow Only on for anything that loops; turn it off only when the content genuinely moves across the frame for good.
  • Raise Padding when the element glows or has a soft shadow — the alpha bounding box will otherwise clip the falloff.
  • Threshold too low picks up invisible noise and inflates the rect; too high eats the soft edges.
  • Cable the output through Get Image Size to lay out the rest of the patch in the crop's honest new size.
  • Stability damps how eagerly the rect follows the content, which is what stops a flickering element from resizing every frame.

Open Crop Image in the interactive catalog →

Crop Image is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Filter nodes