Overview
Fits images of different sizes into a specified canvas. Using the same idea as
CSS object-fit (Contain / Cover / Stretch / None), it standardizes
assets in one node—for example, making every image 64×64 and aligning it bottom-center.
Usage tips
- The go-to pixel-art settings are
fit_mode = Containandsampling = IntegerOnly. Enlargement uses factors such as 2× or 3×; reduction uses reciprocals such as 1/2 or 1/3 and always keeps the whole image in the canvas. - This is useful before building a sprite sheet. Align frames of different sizes
with
None+Bottom-Centerto create an animation anchored at the feet. - For only cropping or adding margins, use
canvas_resize; for free-form scaling alone, usecontent_resize.
Related nodes
canvas_resize— simple canvas changes with fixed placementcontent_resize/pixel_scale— scaling itselfsprite_sheet_pack— a common destination after standardization
Fit modes
| Mode | Label | Effect |
|---|---|---|
| Contain | Contain | Largest size that fits within the canvas; preserves aspect ratio and leaves margins |
| Cover | Cover | Smallest size that covers the canvas; preserves aspect ratio and clips overflow |
| Stretch | Stretch | Ignores the aspect ratio and stretches to fill the canvas |
| None | Placement only | Does not resize; only places the image on the specified canvas |
Scale methods
| Method | Label | Description |
|---|---|---|
| NearestNeighbor | Nearest neighbor | Scales exactly to the fitted dimensions |
| IntegerOnly | Integer only | Enlarges by the largest integer factor (1×, 2×, 3×...) or reduces by the largest fitting integer reciprocal (1/2, 1/3...) |
IntegerOnly is especially useful for pixel art. It avoids fractional enlargement, and when the input is larger than the canvas it chooses 1/2, 1/3, and so on until the whole image fits, so
Containnever crops it.
Examples
Fit pixel art into a preview canvas
Place 16×16 pixel art with width: 64, height: 64, fit_mode: Contain, and sampling: IntegerOnly → 4× scaling to 64×64.
Make a background image cover the canvas
Place a 48×32 background with width: 64, height: 64, fit_mode: Cover, and anchor: Center → preserve the aspect ratio, cover the canvas, and clip the overflow.
Place a sprite on a canvas
Place a 16×16 sprite with width: 32, height: 32, fit_mode: None, and anchor: Bottom-Center → align it bottom-center with margins around it.