Yotsuba Games
Back to Node List

Crop

crop

Extract a fixed-size rectangle; areas outside the source are transparent

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
็”ปๅƒ
input
Image
Required
ๅ…ฅๅŠ›็”ปๅƒ

Output Ports

NameTypeDescription
็”ปๅƒ
output
Image
็ฏ„ๅ›ฒๅค–ใ‚’้€ๆ˜ŽใงๅŸ‹ใ‚ใŸๆŒ‡ๅฎšใ‚ตใ‚คใ‚บใฎๅˆ‡ใ‚ŠๆŠœใ็”ปๅƒ

Parameters

NameTypeDefaultRangeDescription / Options
X
x
Int
00โ€“10000

ๅˆ‡ใ‚ŠๆŠœใ้ ˜ๅŸŸใฎๅทฆ็ซฏ

Y
y
Int
00โ€“10000

ๅˆ‡ใ‚ŠๆŠœใ้ ˜ๅŸŸใฎไธŠ็ซฏ

ๅน…
width
Int
321โ€“8192

ๅˆ‡ใ‚ŠๆŠœใ้ ˜ๅŸŸใฎๅน…

้ซ˜ใ•
height
Int
321โ€“8192

ๅˆ‡ใ‚ŠๆŠœใ้ ˜ๅŸŸใฎ้ซ˜ใ•

Overview

Extracts a rectangular area from an image using coordinates. Use it to take one frame from a sprite sheet, extract the needed area from a large reference image, or remove padding.

Usage tips

  • A frame in a sprite sheet is determined mechanically by x = column ร— frame width, y = row ร— frame height. Turn x into a variable and iterate it with batch_render to process every frame at once. If you want to treat the input as a sprite sheet, the dedicated sprite_sheet_frame_get is easier.
  • To keep the artwork unchanged and only narrow the canvas, use canvas_resize, which supports anchor-based placement such as centering. Crop uses coordinates from the top-left origin.
  • Keep coordinates pixel-accurate. Zoom in on the preview boundary before finalizing it.
  • The output is always exactly width ร— height. Areas outside the sourceโ€”including a rectangle entirely beyond the sourceโ€”are transparent.

Common pitfalls

  • The edge is off by 1px: x/y are zero-based. The second frame starts at x = ใ‚ณใƒžๅน…ร—1.
  • The selection extends beyond the image: the output size stays fixed and the overflow becomes transparent. Check x+width and y+height if transparency is unexpected.
  • Transparent padding should be removed automatically: consider automatic trimming with a content_resize-family node instead of finding coordinates by hand.

Related nodes

  • canvas_resize โ€” anchor-based canvas expansion or reduction, including centering
  • sprite_sheet_frame_get โ€” dedicated frame extraction from a sprite sheet
  • content_resize โ€” resize to the content
  • blend โ€” reposition an extracted part
Back to Node List
Crop โ€” PixPipeline Node Reference