import_image
Draw an image file into a sprite layer at the given x/y coordinates, compositing it over existing pixels and clipping anything outside the canvas.
Instructions
Draw an image file into a layer at (x, y), over the pixels already there.
Transparent pixels of the image leave the layer as it is; a GIF gives its first frame. Parts outside the canvas are dropped: placed and clipped count the image's non-transparent pixels drawn and dropped. The cel is created or grown as needed (a linked cel is unlinked first). Indexed sprites get the nearest palette entry for each colour (partly transparent pixels become opaque), grayscale ones the luma. For indexed sprites, the number of different RGB colours drawn times the palette size may be at most 67108864 (reduce the colours of photo-like images first); nothing changes when it is more. Locked layers, groups and tilemap layers are refused. Images up to 4096x4096. Not available in batch.
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": {
"path": "<path>",
"image": "<image>",
"layer": "<layer>"
},
"name": "import_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Canvas x of the image's left edge | |
| y | No | Canvas y of the image's top edge | |
| path | Yes | Sprite file. Relative paths resolve against the server root. | |
| frame | No | 1-based frame | |
| image | Yes | Image file to draw in (png, gif, bmp, jpg, webp, ...) | |
| layer | Yes | Layer name, or a 'group/child' path for nested layers |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||