import_spritesheet
Slices a sprite sheet image into an animated Aseprite sprite with one frame per cell, using specified frame width, height, and horizontal, vertical, or grid layout.
Instructions
Turn a sprite sheet image into an animated sprite, one frame per cell.
The inbound seam for art made elsewhere, such as a PixelPrep strip, and the reverse of
`export_spritesheet`. Aseprite's own Import Sprite Sheet does the slicing.
Args:
filename: The .aseprite file to create.
source: The sheet: a PNG, or anything else Aseprite opens, in the workspace.
frame_width: One cell's width in pixels.
frame_height: One cell's height in pixels. Both must divide the sheet exactly in
the direction the layout reads it: a partial cell is refused, never cropped
or padded, and the refusal names the sizes that would divide.
layout: "horizontal" reads one row left to right, so frame_height must be the
sheet's height. "vertical" reads one column top to bottom, so frame_width
must be its width. "grid" reads rows left to right, top to bottom.
overwrite: Replace `filename` if it already exists (default False = no-clobber).
The sprite is one cell in size, with one layer holding every frame, in the sheet's
colour mode and palette. An opaque sheet keeps its Background layer, which on an
indexed sheet is what keeps the colour at the transparent palette index visible.
Frames are 100ms: time them with `set_all_frame_durations` or `apply_timing_curve`.
A cell with nothing in it still becomes a frame, and `empty_frames` lists them, so a
grid's spare cells are visible as such. A sheet with frames of its own, such as a
GIF, is refused rather than sliced from its first frame. At most 4,096 frames.
Returns the sprite's info, plus `layer` and `empty_frames`.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>",
"source": "<source>",
"frame_width": "<frame_width>",
"frame_height": "<frame_height>"
},
"name": "import_spritesheet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layout | No | Default: "horizontal". | horizontal |
| source | Yes | ||
| filename | Yes | ||
| overwrite | No | Default: false. | |
| frame_width | Yes | ||
| frame_height | Yes |