import_asset
Import external PNG, GIF, or BMP images onto new or existing layers, or copy named layers from another .aseprite file into a sprite for asset reuse.
Instructions
Import an external image file (PNG/GIF/BMP) onto a new or existing layer, or copy named image layers from another .aseprite file into this sprite.
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": {
"file": "<file>",
"action": "<action>",
"sourceFile": "<sourceFile>"
},
"name": "import_asset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | For image: placement X offset (default 0). | |
| y | No | For image: placement Y offset (default 0). | |
| file | Yes | Destination .aseprite path or '@active' in Live mode. | |
| name | No | For image: new layer name when 'layer' is omitted. | |
| frame | No | For image: target frame (default 1). | |
| layer | No | For image: destination layer name (created if missing). | |
| action | Yes | ||
| layers | No | For copy_layers: layer names/paths to copy (all image layers if omitted). | |
| prefix | No | For copy_layers: optional name prefix for copied layers. | |
| preview | No | Return an inline PNG preview in the same Aseprite call (true or options object). | |
| sourceFile | Yes | Source image path (action='image') or source .aseprite path (action='copy_layers'). | |
| expandFrames | No | For copy_layers: add frames if source sprite has more frames. | |
| resizeCanvas | No | For image: expand canvas if imported image exceeds bounds. |