Aseprite Claude Connector
v0.5.1Let Claude draw in a running Aseprite, and export straight to Godot or Unity
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
status
Report backend health plus this server's version and whether a newer release exists. Live: whether Aseprite is connected + its version. Headless: the resolved Aseprite executable path and whether it exists.
get_sprite_info
Get the active sprite's size, color mode, and layer/frame/tag lists. Headless: pass ``file`` (the .aseprite to inspect).
| Parameter | Type | Description |
|---|---|---|
file |
describe_sprite
Summarize the active sprite in one call: size, color mode, the layer tree with visibility and blend modes, frame timing, tags, slices, palette, the selection, and what's active. Frame durations and palette colors stop at 64 entries; ``count`` always gives the full number.
| Parameter | Type | Description |
|---|---|---|
file |
get_pixel
Read one composited pixel (all layers) at (x, y) as #rrggbbaa.
| Parameter | Type | Description |
|---|---|---|
x * | integer | |
y * | integer | |
file |
set_sprite_metadata
Attach typed key/value metadata to the sprite (Aseprite's Properties system — stored in the .aseprite file itself). Values may be strings, numbers, or booleans. Useful for provenance ("generated_by", spec IDs) and pipeline state. One undo step.
| Parameter | Type | Description |
|---|---|---|
entries * | object | |
file |
get_sprite_metadata
Read the sprite's typed key/value metadata (Properties).
| Parameter | Type | Description |
|---|---|---|
file |
get_pixels
Read a composited pixel region as a grid of #rrggbbaa strings — the AI feedback loop for 'what does the canvas look like now'. Capped at 4096 px; use a smaller region or export for larger areas.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
file |
look
See the canvas: returns a frame as an image, scaled up with sharp pixels. Defaults to the active frame with all visible layers. ``layer`` shows one layer or group alone (even if hidden). ``x``/``y``/``width``/``height`` crop to a region, and ``selection`` crops to the current selection. ``scale`` is an integer zoom (1-32); omit it to fit ``max_size``. ``background`` is ``checker``, ``transparent``, or a #rrggbb color. Prefer a crop when you only need part of the canvas: images use up conversation space. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
background | string | |
file | ||
frame | ||
height | ||
layer | ||
max_size | integer | |
scale | ||
selection | boolean | |
width | ||
x | ||
y |
look_animation
See an animation: returns a tag or frame range as one image, frames left to right and top to bottom. Defaults to every frame, capped at 64. A range of up to 6 frames is a strip and longer ones are a grid, unless ``columns`` is set. The result lists each cell's frame and duration. ``layer``, ``scale``, ``max_size``, and ``background`` work as in ``look``. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
background | string | |
columns | ||
file | ||
from_frame | ||
layer | ||
max_size | integer | |
scale | ||
tag | ||
to_frame |
look_onion
See motion: returns ``frame`` as an image with earlier frames ghosted in red and later frames in blue, so the whole arc shows at once. Defaults to the active frame. The picture form of ``render_onion_composite``. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
background | string | |
file | ||
frame | ||
max_size | integer | |
next | integer | |
opacity | number | |
prev | integer | |
scale |
split_sheet
Cut a character sheet (poses in a ``columns`` x ``rows`` grid) into one pixel-art sprite per pose, all at the same scale and on ONE shared palette of ``colors`` colours (or ``palette``), so the poses stay consistent with each other. Each cell is shrunk to ``width`` x ``height`` (the cell's aspect by default), its background cleared and the bits of neighbouring poses dropped. Each sprite gets a tag named from ``names`` (row by row; "pose_1"... by default), so ``pin_sprite(tag=...)`` can pick it. Live: opens the sprites in the editor. Headl…
| Parameter | Type | Description |
|---|---|---|
columns * | integer | |
image_path * | string | |
rows * | integer | |
width * | integer | |
clear_edges | boolean | |
colors | integer | |
dither | string | |
height | ||
layer_name | string | |
names | ||
out_dir | ||
palette | ||
remove_background | boolean |
pixelate_reference
Turn a reference picture into pixel art on a new layer: the faithful way to recreate a photo or painting. The picture (or the ``crop_*`` part of it, in its own pixels) is shrunk to ``width`` x ``height`` by averaging, so each pixel is the true colour of that area. ``height`` defaults to the picture's aspect. It is then snapped to ``colors`` colours chosen from the picture, or to ``palette`` (#rrggbb list) to match an existing one. ``dither`` is ``none``, ``ordered``, or ``diffusion``. ``despeckle`` removes lone noise pixels. ``remove_back…
| Parameter | Type | Description |
|---|---|---|
image_path * | string | |
width * | integer | |
clear_edges | boolean | |
colors | integer | |
crop_height | ||
crop_width | ||
crop_x | ||
crop_y | ||
despeckle | boolean | |
dither | string | |
file | ||
height | ||
layer_name | string | |
palette | ||
remove_background | boolean | |
x | integer | |
y | integer |
compare_to_reference
See how close the canvas is to a reference picture. Returns the reference shrunk to the canvas size, the canvas, and a heatmap (red = most different) side by side, plus scores out of 100: ``score`` per pixel, ``shape_score`` with fine detail blurred away (composition, values, and colour masses), and ``close_pixels`` (% that nearly match). ``worst_areas`` are the cells of a ``grid`` x ``grid`` split that differ most, with both average colours and whether the art is darker or lighter: fix those first. ``crop_*`` picks the part of the refere…
| Parameter | Type | Description |
|---|---|---|
image_path * | string | |
crop_height | ||
crop_width | ||
crop_x | ||
crop_y | ||
file | ||
frame | ||
grid | integer | |
layer | ||
max_size | integer |
ambient_motion
Bring a still scene to life as a seamless loop. ``layer`` (the active layer by default) is animated from ``from_frame`` over ``frames`` frames of ``duration_ms``: ``wind`` (pixels, try 1) sends gusts rolling left to right, one per ``wavelength`` pixels; ``shimmer`` (pixels) wobbles rows like water; ``glint`` (0-1) sweeps light across the bright pixels once a loop. ``particles`` adds a layer of ``motes``, ``snow``, ``rain``, or ``embers``. Animate each part on its own layer (see ``split_into_layers``) so armour can glint while grass blows.…
| Parameter | Type | Description |
|---|---|---|
duration_ms | integer | |
file | ||
frames | integer | |
from_frame | integer | |
glint | number | |
glint_color | string | |
layer | ||
particle_colors | ||
particle_count | integer | |
particles | ||
seed | integer | |
shimmer | number | |
tag | string | |
wavelength | integer | |
wind | number |
split_into_layers
Separate a picture into parts on their own layers, like armour and meadow, so each can be edited or animated alone. ``seeds`` are points on each part: ``[{"name": "armour", "x": 90, "y": 40}, {"name": "meadow", "x": 5, "y": 5}]``. The first part named ends up on top. Each part grows from its seeds and stops where colours change sharply, so put a seed on every distinct area of a part (a part may have many seeds). If a part leaks into another, add seeds where it leaked and run it again. ``layer`` defaults to the active one, which is hidden afterwar…
| Parameter | Type | Description |
|---|---|---|
seeds * | array | |
file | ||
frame | ||
hide_source | boolean | |
layer |
extend_scene
Grow the canvas by ``left``/``right``/``top``/``bottom`` pixels and fill the new space on ``layer`` (the active one) by continuing its own texture, like turning a portrait scene into a wide banner. Patches of ``patch`` pixels are copied from the ``sample_*`` area (all of the layer by default) and matched to what is already beside them, so no new colours appear. Pick a sample of pure background, like open meadow, so the subject isn't copied, and big enough not to repeat. The margins come from ``frame`` and are shared by the layer's other f…
| Parameter | Type | Description |
|---|---|---|
bottom | integer | |
file | ||
frame | ||
layer | ||
left | integer | |
patch | integer | |
right | integer | |
sample_height | ||
sample_width | ||
sample_x | ||
sample_y | ||
seed | integer | |
top | integer |
clean_pixel_art
Make pixelated or noisy art read as drawn: every patch of one colour smaller than ``min_region`` pixels merges into the colour around it, if that colour is close (``tolerance``, 0-1; standout specks like flowers stay), and ``firm_edges`` darkens the shadow side of strong edges with the art's own darker shade. No new colours. ``layer`` defaults to the active one; one frame, or ``all_frames``. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
all_frames | boolean | |
file | ||
firm_edges | boolean | |
frame | ||
layer | ||
min_region | integer | |
tolerance | number |
draw_eyes
Redraw a character's eyes, frame by frame, to give it an expression: where it looks, blinks, sleepy or angry lids, a smile. ``eyes`` lists each eye's socket, the area INSIDE its ring, in canvas pixels: ``{"x": 44, "y": 27.5, "rx": 6.5, "ry": 6.3}``, optionally ``"pupil": [rx, ry]`` (about half the socket by default), ``"look_scale"`` (0.7 for a far eye in a 3/4 view) and ``"inner": "left"|"right"`` (the side toward the beak or nose, for brows). Measure sockets with ``look`` first. ``keys``, one per frame (frames are made as needed): ``{"f…
| Parameter | Type | Description |
|---|---|---|
eyes * | array | |
file | ||
keys | ||
layer | ||
style |
swing_part
Swing a wing, arm, tail or ear about its joint across frames. ``outline`` is a polygon round the part, in canvas pixels ``[[x, y], ...]``; keep it to the part itself (not the face or chest beside it). ``pivot`` is the joint. ``keys``, one per frame (frames are made as needed): ``{"frame": 2, "angle": 10, "dx": 0, "dy": -1, "ms": 90}``, angle in degrees clockwise. Where the part met the body, a ``band`` of ``shadow`` (the part's darkest colour by default) stays underneath, so turning never opens a gap, and the part's light outer halo is dr…
| Parameter | Type | Description |
|---|---|---|
keys * | array | |
outline * | array | |
pivot * | array | |
band | integer | |
file | ||
layer | ||
shadow |
bob_body
Breathing, hops and sways: everything above the row ``feet_y`` moves while the feet below it stay planted. Put ``feet_y`` at the top of the feet. ``keys``, one per frame (frames are made as needed): ``{"frame": 1, "dy": -1, "dx": 0, "ms": 160}``; -1 rises a pixel (the legs stretch), +1 sinks. Breathing is 0/-1; a hop -2..-4; a sway dx -1/+1. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
feet_y * | integer | |
keys * | array | |
file | ||
layer |
lift_symbols
Move floating symbols ("!", "?", Zzz, hearts, sparkles) off a character's layer onto a new layer, and animate them there. ``boxes`` are ``[x, y, w, h]`` round each symbol (or group); only pixels not joined to the body are taken, so a box can overlap a wing. They're found on ``from_frame`` and erased from every frame of ``layer``. ``keys``, one per frame (frames are made as needed): ``{"frame": 2, "symbols": [[dx, dy], null], "ms": 100}``, an offset per box, or null to hide it. Frames without a key show them in place. One undo step. Headle…
| Parameter | Type | Description |
|---|---|---|
boxes * | array | |
file | ||
from_frame | integer | |
keys | ||
layer | ||
name | string |
check_consistency
Compare sprites of one character or set: the open sprites (live; ``only`` picks them by filename or tag), or ``files``. Reports colours so close they should be one (the drift you get from pixelating poses separately), the colours only one sprite uses, and how tall the subject stands on frame 1 of each, so differences in scale show. Close colours every sprite uses side by side are shading steps, not drift. Poses lying down or crouching are shorter by nature. Fix colours with ``match_palettes``. Read-only.
| Parameter | Type | Description |
|---|---|---|
files | ||
only | ||
tolerance | number |
match_palettes
Put sprites of one character or set on one shared palette: colours closer than ``tolerance`` that stand in for each other (one sprite uses one, another sprite the other) merge into whichever is used most, across the open sprites (live; ``only`` picks them by filename or tag) or ``files``. Alpha is kept. One undo step per sprite. Check first with ``check_consistency``.
| Parameter | Type | Description |
|---|---|---|
files | ||
only | ||
tolerance | number |
animate_parts
Animate a character made of part layers like a cut-out puppet. ``poses`` are key poses: ``{"frame": 1, "part": "Arm", "angle": -20, "x": 0, "y": 1}``, with ``angle`` in degrees clockwise and ``x``/``y`` a move in pixels; any left out are 0. Frames between keys are filled in (``easing`` is ``smooth`` or ``linear``), and with ``loop`` the last pose eases back to the first. ``pivots`` maps a part to the [x, y] it turns about (a shoulder, a hip; its middle by default). ``parents`` maps a part to the one it hangs from, so ``{"Forearm": "Arm"}`…
| Parameter | Type | Description |
|---|---|---|
frames * | integer | |
poses * | array | |
duration_ms | integer | |
easing | string | |
file | ||
from_frame | integer | |
loop | boolean | |
parents | ||
pivots | ||
tag | string |
relight_scene
Show a scene at another time of day: ``dawn``, ``noon``, ``sunset``, or ``night``. Each colour's lightness, warmth, and saturation shift the way that light would, and each maps to one new colour, so the colour count stays the same. ``glows`` are lanterns or windows, ``[[x, y, radius], ...]``, whose pools stay warm and lit. ``strength`` (0-1) blends toward the original. Works on ``layers`` (every visible image layer by default), writing a copy named like "Ground (night)" above each and hiding the original, so switching back is a visibility…
| Parameter | Type | Description |
|---|---|---|
time * | string | |
all_frames | boolean | |
file | ||
glows | ||
layers | ||
strength | number |
make_normal_map
Make a normal map so the art reacts to 2D lights in Godot and Unity: a torch moving past shades it. Forms round off over ``bevel`` pixels from their outline, ``detail`` (0-1) lets bright areas stand forward, and ``strength`` steepens it all. It goes on a hidden "Normal map" layer, and ``save_path`` also writes it as a PNG strip matching an exported sprite sheet (frames side by side). In Godot, set it as the normal map of a CanvasTexture whose diffuse is the sprite; in Unity, add it to the sprite's Secondary Textures as ``_NormalMap``. Mad…
| Parameter | Type | Description |
|---|---|---|
all_frames | boolean | |
bevel | integer | |
detail | number | |
file | ||
layer | ||
save_path | ||
strength | number |
make_seamless
Make a texture repeat with no visible edge, for ground, walls, or water tiles. The layer (the active one by default) fills the canvas: it is shifted by half so its old edges meet in the middle, and that cross, ``band`` pixels wide (an eighth of the size by default), is rebuilt from ``patch``-sized pieces of the texture itself. Check it with ``look`` after ``expand_canvas`` or by exporting a few side by side. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
band | ||
file | ||
frame | ||
layer | ||
patch | integer | |
seed | integer |
make_autotiles
Build the 47-tile autotile set for one terrain (``fill_layer``, like grass) over another (``base_layer``, like dirt, or clear), so a map painter picks the right edge and corner for every neighbour. Both textures come from the top-left ``size`` square of their layer, so ``make_seamless`` them first. ``edge`` is how far the fill stops from an open side, and ``outline`` gives its border a darker shade of its own colours. Writes ``name``.png. With ``game_dir`` (or the remembered game folder, if ``out_dir`` isn't given), a Godot project also g…
| Parameter | Type | Description |
|---|---|---|
fill_layer * | string | |
name * | string | |
size * | integer | |
base_layer | ||
edge | ||
file | ||
frame | integer | |
game_dir | ||
out_dir | ||
outline | boolean |
export_animation
Write the animation (or one ``tag``) as a looping ``.gif`` or animated ``.png`` at ``path``, scaled up ``scale`` times with sharp pixels (4 turns a 384x128 banner into 1536x512). Each frame keeps its own duration. An animated PNG keeps transparency; a GIF is laid on ``background`` (#rrggbb, black by default), as are both when it's given. Written from Python, so the live editor shows no security prompt. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
background | ||
file | ||
scale | integer | |
tag |
clean_lines
Turn rough sketched strokes into clean pixel-art lines: ``thin`` brings thick strokes down to one pixel, and the doubled corner pixels freehand lines leave are removed, as Aseprite's pixel-perfect brush would have drawn them. ``specks`` also clears pixels with no neighbour. Kept pixels keep their colour. Use it on a line-art layer over transparency (``layer``, the active one by default); one frame, or ``all_frames``. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
all_frames | boolean | |
file | ||
frame | ||
layer | ||
specks | boolean | |
thin | boolean |
search_api_docs
Search Aseprite's Lua scripting API reference, bundled with this server. Use it before writing ``run_lua`` code, for a class, method, or property such as ``Image:drawImage`` or ``selection bounds``.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer |
search_manual
Search Aseprite's user manual: how features work in the editor, such as tilemaps, onion skinning, or slices. The first search downloads the manual from GitHub to your cache, then it refreshes every 30 days.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer |
set_safety_rails
Set the safety rails for this session, or pass nothing to read them. ``dry_run`` true makes every edit report what it would change, as an error, then roll back; tools that save, export, or run raw Lua refuse instead. ``max_changed_pixels`` caps what one call can change, and an edit over it is rolled back; 0 removes the cap. It counts hidden layers. ``move_layer`` isn't capped, and ``run_lua`` is capped only with ``edit=true``.
| Parameter | Type | Description |
|---|---|---|
dry_run | ||
max_changed_pixels |
edit_batch
Run several editing tools as one undo step, so one Ctrl-Z reverts them all. Each step is ``{"tool": "draw_line", "args": {...}}``, in order. If any step fails, none of them apply. The pixel cap covers the whole batch. Steps can't see each other's results, and tools that save or export can't be batched. Headless: pass ``file`` here, not in the steps.
| Parameter | Type | Description |
|---|---|---|
steps * | array | |
file | ||
label | string |
edit_in_selection
"Fix this bit": run editing tools so they change only what's inside the current selection, as one undo step. Anything they'd do outside it, on any layer or frame, is put back. Steps are written as in ``edit_batch``. Select the area in Aseprite first; ``look`` with ``selection`` shows what's selected. Steps can't change the frames, layers, or canvas size. Headless: pass ``file`` here, not in the steps.
| Parameter | Type | Description |
|---|---|---|
steps * | array | |
file | ||
label | string |
open_sprite
Open a sprite file and make it the active document; returns its filename, size, and frame/layer counts. Live: opens a new tab in the editor and makes it the sprite Claude works on. Headless: each call is a fresh process, so this is a "can Aseprite read this file" probe returning the file's info — to edit a file headless, pass it as the ``file`` argument of the editing tools instead.
| Parameter | Type | Description |
|---|---|---|
path * | string |
save_sprite
Save the active sprite to disk: to ``path`` if given (save-as; the document's filename follows it), else to its own filename — errors if the sprite is untitled and no ``path`` is given. Live: persists the edits sitting in the open editor. Headless: mutating tools already save to ``file`` on their own; use this with both arguments to write a copy of ``file`` under a new ``path`` (the source file on disk stays untouched).
| Parameter | Type | Description |
|---|---|---|
file | ||
path |
close_sprite
Close the active sprite. Errors if it has unsaved changes unless ``force=true`` — save_sprite first, or force to discard them. Aimed at the live editor (frees the tab); headless has no persistent session, so there is nothing to close there.
| Parameter | Type | Description |
|---|---|---|
force | boolean |
set_active_sprite
Live editor only: make one of the open documents active, found by exact filename or basename match (e.g. "turret.aseprite"). Returns which sprite matched and how. Subsequent tools operate on it, even if the artist clicks another tab. Unsaved sprites share a name: pick those with ``pin_sprite``.
| Parameter | Type | Description |
|---|---|---|
filename * | string |
pin_sprite
Live editor only: choose the sprite Claude's edits go to. Every tool then works on it even while the artist looks at another tab. Pick it by ``filename`` (full path or basename), by a ``tag`` it has (the way to tell unsaved sprites apart), or give neither to pin the sprite the artist has open now ("work on this one"). ``unpin`` goes back to following whichever sprite is active. Sprites Claude creates or opens are pinned on their own.
| Parameter | Type | Description |
|---|---|---|
filename | ||
tag | ||
unpin | boolean |
save_all_sprites
Live editor only: save open work into ``folder`` as ``.aseprite`` files, so nothing is lost when tabs are closed. Unsaved sprites are saved there and become those files (named after their first tag); sprites that already have a file and unsaved changes are COPIED there, leaving their own file untouched. ``all_sprites`` copies unchanged ones too. ``only`` limits it to sprites with these filenames or tags. Never overwrites: a taken name gets a number.
| Parameter | Type | Description |
|---|---|---|
folder * | string | |
all_sprites | boolean | |
only |
list_sprites
Live editor only: list every open document — filename (or "(unsaved)"), size, frame/layer counts, tags, unsaved-changes flag, which one is active in the editor, and which one Claude's edits go to (``pinned``).
create_sprite
Create a new sprite. Live: opens a new untitled sprite in the editor and makes it the sprite Claude works on, even if the artist clicks another tab. Headless: writes a new .aseprite to ``file`` (required). ``color_mode`` is one of rgb | gray | indexed.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
color_mode | string | |
file |
expand_canvas
Grow (or shrink, with negatives) the canvas per side WITHOUT scaling content — existing pixels keep their positions relative to the old origin. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
bottom | integer | |
file | ||
left | integer | |
right | integer | |
top | integer |
import_spritesheet
Slice a sheet PNG into animation frames: cells are read row-major at the given frame size onto a new "imported" layer, adding frames as needed. The sheet's dimensions must be exact multiples of the frame size. One undo step. Headless: pass ``file`` (the target sprite).
| Parameter | Type | Description |
|---|---|---|
frame_height * | integer | |
frame_width * | integer | |
sheet_path * | string | |
file |
add_layer
Add a new empty layer (optionally named) at the top of the stack.
| Parameter | Type | Description |
|---|---|---|
file | ||
name |
add_group
Add a layer group. Move layers into it with ``move_layer_to_group``; reference nested layers anywhere by name or as ``Group/Layer``.
| Parameter | Type | Description |
|---|---|---|
file | ||
name |
move_layer_to_group
Move a layer inside a layer group.
| Parameter | Type | Description |
|---|---|---|
group * | string | |
layer * | string | |
file |
list_layers
The full layer tree, top of stack first: name, path, kind (image/group/tilemap), visibility, and opacity — including layers nested in groups (which ``get_sprite_info`` lists only at the top level).
| Parameter | Type | Description |
|---|---|---|
file |
delete_layer
Delete the layer with the given name.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
file |
rename_layer
Rename a layer.
| Parameter | Type | Description |
|---|---|---|
new_name * | string | |
old_name * | string | |
file |
set_layer_visibility
Show or hide a layer.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
visible * | boolean | |
file |
set_layer_opacity
Set a layer's opacity (0-255).
| Parameter | Type | Description |
|---|---|---|
name * | string | |
opacity * | integer | |
file |
flatten_sprite
Flatten all layers into a single layer.
| Parameter | Type | Description |
|---|---|---|
file |
set_layer_blend_mode
Set a layer's blend mode. One of: normal, multiply, screen, overlay, darken, lighten, color_dodge, color_burn, hard_light, soft_light, difference, exclusion, hue, saturation, color, luminosity, addition, subtract, divide.
| Parameter | Type | Description |
|---|---|---|
mode * | string | |
name * | string | |
file |
duplicate_layer
Duplicate a layer (with its cels) above the original.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
file |
merge_layer_down
Merge a layer into the layer directly beneath it.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
file |
move_layer
Reorder a layer in the stack. ``direction`` is up | down | top | bottom (bottom = stack index 1).
| Parameter | Type | Description |
|---|---|---|
direction * | string | |
name * | string | |
file |
import_image_as_layer
Import an external image file (PNG, etc.) into a new layer at (x, y) — a reference/trace layer for concept-art intake. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
image_path * | string | |
file | ||
layer_name | ||
x | integer | |
y | integer |
add_frame
Append a new empty frame.
| Parameter | Type | Description |
|---|---|---|
file |
duplicate_frame
Duplicate frame ``number`` (1-based).
| Parameter | Type | Description |
|---|---|---|
number * | integer | |
file |
delete_frame
Delete frame ``number`` (1-based). Cannot delete the last frame.
| Parameter | Type | Description |
|---|---|---|
number * | integer | |
file |
set_frame_duration
Set frame ``number``'s duration in milliseconds.
| Parameter | Type | Description |
|---|---|---|
ms * | integer | |
number * | integer | |
file |
add_frames
Append ``count`` empty frames in one undo step.
| Parameter | Type | Description |
|---|---|---|
count * | integer | |
file |
set_frame_durations
Set every frame in [from_frame..to_frame] to ``ms`` milliseconds.
| Parameter | Type | Description |
|---|---|---|
from_frame * | integer | |
ms * | integer | |
to_frame * | integer | |
file |
reverse_frames
Reverse frame order (cels on every layer, plus durations) — the whole sprite by default, or the inclusive [from_frame..to_frame] range. One undo step.
| Parameter | Type | Description |
|---|---|---|
file | ||
from_frame | ||
to_frame |
set_onion_skin
Configure the editor's onion-skin view: on/off, ghost counts each direction, and whether ghosting stays inside the current tag. A view preference — visually meaningful in the live editor. (For a rendered onion-skin image any backend can produce, use ``render_onion_composite``.)
| Parameter | Type | Description |
|---|---|---|
active * | boolean | |
file | ||
loop_tag | ||
next_frames | integer | |
prev_frames | integer |
clear_cel
Empty the cel at the given layer + frame (transparent).
| Parameter | Type | Description |
|---|---|---|
file | ||
frame | ||
layer |
set_cel_position
Move the cel's top-left origin to (x, y).
| Parameter | Type | Description |
|---|---|---|
x * | integer | |
y * | integer | |
file | ||
frame | ||
layer |
set_cel_opacity
Set the cel's opacity (0-255).
| Parameter | Type | Description |
|---|---|---|
opacity * | integer | |
file | ||
frame | ||
layer |
draw_pixels
Set individual pixels: ``pixels`` is a list of ``{"x": int, "y": int, "color": "#rrggbb[aa]"}``. The precision tool for detail work — one undo step for the whole batch. Capped at 4096 pixels per call. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
pixels * | array | |
file | ||
preview | boolean |
draw_polyline
Stroke connected line segments through ``points`` (ordered [x, y] pairs); ``close=True`` joins the last point back to the first. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
points * | array | |
close | boolean | |
file | ||
preview | boolean |
draw_rectangle
Draw a rectangle on the active layer + frame. ``color`` is #rrggbb or #rrggbbaa. ``fill`` false draws only the outline. One undo step (live). Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
file | ||
fill | boolean | |
preview | boolean |
draw_line
Draw a 1px line from (x1,y1) to (x2,y2). One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
x1 * | integer | |
x2 * | integer | |
y1 * | integer | |
y2 * | integer | |
file | ||
preview | boolean |
draw_circle
Draw a circle centered at (center_x, center_y). ``fill`` true fills the disk. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
center_x * | integer | |
center_y * | integer | |
color * | string | |
radius * | integer | |
file | ||
fill | boolean | |
preview | boolean |
fill_area
Flood-fill the contiguous same-color region at (x, y). Most reliable on RGB sprites. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
x * | integer | |
y * | integer | |
file | ||
preview | boolean |
draw_ellipse
Draw an ellipse centered at (center_x, center_y) with independent x/y radii. ``fill`` true fills it. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
center_x * | integer | |
center_y * | integer | |
color * | string | |
radius_x * | integer | |
radius_y * | integer | |
file | ||
fill | boolean | |
preview | boolean |
draw_gradient
Fill a rectangle with a linear gradient from ``color1`` to ``color2``. ``direction`` is horizontal | vertical | diagonal. ``dither`` true uses an ordered Bayer dither between the two colors instead of blending RGB — the palette-friendly way. With ``dither``, ``bands`` above 1 steps through that many solid colors and dithers only the seams, which reads far cleaner than one dither across a tall area. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
color1 * | string | |
color2 * | string | |
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
bands | integer | |
direction | string | |
dither | boolean | |
file | ||
preview | boolean |
apply_dither
Fill a rectangle with a uniform ordered (Bayer 4x4) dither mixing ``color1`` and ``color2``. ``density`` 0..1 is the fraction of ``color2`` — 0.5 is an even checker-style mix. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
color1 * | string | |
color2 * | string | |
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
density | number | |
file | ||
preview | boolean |
add_outline
Add a 1px outline around the opaque pixels of a layer, in ``color`` — readability against busy backgrounds. ``selective`` true ignores ``color`` and darkens each neighbouring pixel's own color instead, for a softer outline that follows the art (RGB sprites). ``diagonal`` true also outlines diagonally (8-connected). ``layer`` picks the layer, and ``all_frames`` outlines every cel on it rather than the active one. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and b…
| Parameter | Type | Description |
|---|---|---|
all_frames | boolean | |
color | string | |
diagonal | boolean | |
file | ||
layer | ||
preview | boolean | |
selective | boolean |
get_palette
Return the active sprite's palette as #rrggbbaa hex strings.
| Parameter | Type | Description |
|---|---|---|
file |
set_palette_color
Set palette entry ``index`` to ``color`` (#rrggbb or #rrggbbaa).
| Parameter | Type | Description |
|---|---|---|
color * | string | |
index * | integer | |
file |
add_palette_color
Append ``color`` to the palette and return its new index.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
file |
set_palette
Replace the whole palette with ``colors`` (list of #rrggbb/#rrggbbaa).
| Parameter | Type | Description |
|---|---|---|
colors * | array | |
file |
apply_preset_palette
Replace the palette with a built-in preset: gameboy | pico8 | cga.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
file |
generate_color_ramp
Generate a dark->light shading ramp from ``base_color`` and APPEND it to the palette in order — ready for ``palette_ramp_walk``. ``count`` colors; ``hue_shift`` pushes shadows toward blue and highlights toward yellow. Returns the ramp as hex. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
base_color * | string | |
count | integer | |
file | ||
hue_shift | boolean |
extract_palette_from_image
Extract a palette (median-cut) from an external image file and, by default, set it as the active sprite's palette — the concept-art → locked-palette step. Returns the colors as hex, sorted dark→light. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
image_path * | string | |
file | ||
max_colors | integer | |
replace | boolean |
sort_palette
Reorder palette swatches by ``luminance`` (default), ``hue``, or ``saturation``. Intended for RGB sprites' swatch organization — on an INDEXED sprite this changes which color each pixel shows (indices aren't remapped). One undo step.
| Parameter | Type | Description |
|---|---|---|
ascending | boolean | |
by | string | |
file |
palette_from_sprite
Derive the palette FROM the sprite's actual pixels (Aseprite's color quantization) — the inverse of ``quantize_to_palette``. Returns the new palette as hex. One undo step.
| Parameter | Type | Description |
|---|---|---|
file | ||
max_colors | integer |
load_palette
Replace the sprite's palette from a palette file (.gpl, .pal, .ase, .png strip — anything Aseprite reads). One undo step.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
file |
save_palette
Write the sprite's palette to a file (.gpl, .pal, .png — by extension).
| Parameter | Type | Description |
|---|---|---|
path * | string | |
file |
apply_bundled_palette
Apply one of Aseprite's bundled extension palettes by resource ID — e.g. DB16, DB32, ARQ4, EDG16 (availability depends on the installed palette extensions). For gameboy/pico8/cga see ``apply_preset_palette``. One undo step.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
file |
replace_color
Replace every pixel matching ``from_color`` (within ``tolerance``, a 0-255 RGB distance) with ``to_color`` across the active cel, preserving each pixel's alpha unless ``to_color`` carries its own. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
from_color * | string | |
to_color * | string | |
file | ||
tolerance | integer |
quantize_to_palette
Snap every opaque pixel of the active cel to its nearest color in the sprite's palette (alpha preserved) — enforce palette discipline after intake or shading. RGB sprite; one undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file |
adjust_hsl
Shift the active cel's colors in HSL: ``hue_shift`` degrees (-360..360), ``saturation`` a multiplier (1.0 = unchanged), ``lightness`` a delta (-1..1). Useful for tint variants. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file | ||
hue_shift | number | |
lightness | number | |
saturation | number |
get_color_stats
Return a color histogram of the composited sprite: distinct opaque color count, total opaque pixels, and the ``top`` most-used colors with counts — a palette-drift check for the art-QA loop. Read-only. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file | ||
top | integer |
apply_shading
Palette-constrained shading: brighten toward the light and darken away from it, snapping every pixel to the nearest palette color. ``intensity`` ~0..1. RGB sprite only; one undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
light_direction * | string | |
width * | integer | |
x * | integer | |
y * | integer | |
file | ||
intensity | number |
palette_ramp_walk
Shade by WALKING the arranged palette ±N indices toward lighter/darker (per light direction), instead of snapping to the luminance-nearest color — so hand-ordered shading ramps are respected. ``steps`` = max indices to walk at the fully-lit/shadowed edges. RGB sprite with an ordered ramp palette; one undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
light_direction * | string | |
width * | integer | |
x * | integer | |
y * | integer | |
file | ||
steps | integer |
adjust_brightness_contrast
Adjust the active cel's brightness and contrast, each -100..100 (0 = unchanged). Alpha is preserved. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
brightness | integer | |
contrast | integer | |
file |
invert_colors
Invert the active cel's RGB (alpha untouched). One undo step.
| Parameter | Type | Description |
|---|---|---|
file |
desaturate
Convert the active cel to grayscale (Rec. 601 luma), keeping alpha. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file |
box_blur
Blur the active cel with an alpha-weighted box kernel. ``radius`` 1-4 (1 = 3x3). Transparent neighbors don't darken edges. One undo step.
| Parameter | Type | Description |
|---|---|---|
file | ||
radius | integer |
sharpen
Sharpen the active cel (unsharp mask over a 3x3 neighborhood). ``strength`` 0.1-2.0. Only opaque pixels are considered, so sprite edges don't halo against transparency. One undo step.
| Parameter | Type | Description |
|---|---|---|
file | ||
strength | number |
paint_with_stamp
Stamp an image at each [x, y] in ``points`` (points are stamp centers). The stamp comes from ``source_path`` (a PNG) or ``source_rect`` ([x, y, width, height] cut from the composited sprite). One undo step for the whole scatter. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
points * | array | |
file | ||
layer | ||
preview | boolean | |
source_path | ||
source_rect |
draw_iso_box
Draw a 2:1 isometric box. The footprint diamond is centered at (center_x, center_y) with the given ``half_width`` (full tile width = 2×half_width), rising ``height`` px. Top/left/right faces are auto-shaded from ``color`` (#rrggbb, light from top-left) with stroke + highlight. Returns the top/SE/SW face corner polygons so you can attach recessed ports or details. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
center_x * | integer | |
center_y * | integer | |
color * | string | |
half_width * | integer | |
height * | integer | |
file | ||
preview | boolean |
draw_iso_cylinder
Draw a vertical isometric cylinder (tank/silo/chimney): top ellipse + shaded body + front rim, auto-shaded from ``color``. ``top_y`` is the top of the body. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
center_x * | integer | |
color * | string | |
height * | integer | |
radius * | integer | |
top_y * | integer | |
file | ||
preview | boolean |
fill_polygon
Scanline-fill an arbitrary polygon given ``points`` (a list of [x, y] pairs, in order). ``color`` is #rrggbb or #rrggbbaa. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
points * | array | |
file | ||
preview | boolean |
iso_recessed_panel
Draw a recessed docking socket/port on an isometric face — a light lit lip framing a dark recessed interior. ``points`` = the 4 corner [x, y] pairs of a face (e.g. the ``face_se`` returned by draw_iso_box). This is the consistent I/O-port style. One undo step. Headless: pass ``file``. ``preview`` true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
| Parameter | Type | Description |
|---|---|---|
points * | array | |
file | ||
preview | boolean |
select_rectangle
Set a rectangular selection. Most meaningful on the live editor.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
file |
select_all
Select the whole canvas.
| Parameter | Type | Description |
|---|---|---|
file |
deselect
Clear the current selection.
| Parameter | Type | Description |
|---|---|---|
file |
select_ellipse
Select an ellipse inscribed in the given rectangle. ``mode`` is ``replace`` (default), ``add``, or ``subtract`` against the current selection.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
file | ||
mode | string |
select_by_color
Select every pixel matching ``color`` (composited, within ``tolerance`` 0-255 per channel) — a global magic wand. ``mode`` is ``replace``/``add``/``subtract``.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
file | ||
mode | string | |
tolerance | integer |
invert_selection
Invert the current selection against the canvas bounds.
| Parameter | Type | Description |
|---|---|---|
file |
get_selection
Report whether a selection exists and its bounding rectangle. (Selection is editor-session state — in headless mode it doesn't persist between calls, so this is mainly a live-editor tool.)
| Parameter | Type | Description |
|---|---|---|
file |
erase_area
Erase pixels to transparent. Pass an explicit rect (works everywhere, including headless), or pass nothing to erase the current selection — including non-rectangular ones (live editor). One undo step.
| Parameter | Type | Description |
|---|---|---|
file | ||
height | ||
width | ||
x | ||
y |
flip_sprite
Flip the whole sprite horizontally or vertically.
| Parameter | Type | Description |
|---|---|---|
direction * | string | |
file |
resize_sprite
Scale the whole sprite to new pixel dimensions.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
file |
crop_sprite
Crop the sprite to the given rectangle.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
file |
rotate_sprite
Rotate the whole sprite by 90, 180, or 270 degrees clockwise (lossless). One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
degrees * | integer | |
file |
autocrop_sprite
Trim transparent borders: shrink the canvas to the union of visible content across all layers and frames (Sprite > Trim). Errors if the sprite is fully transparent. Returns the old and new size. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file |
set_color_mode
Convert the sprite between rgb | gray | indexed color modes. ``dithering`` applies only when converting to indexed: ordered | old | error-diffusion (default none). Returns the old and new mode. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
mode * | string | |
dithering | ||
file |
create_slice
Create a named slice (atlas region) at the given rectangle. Slices become Unity sprites via export_unity_slices. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
name * | string | |
width * | integer | |
x * | integer | |
y * | integer | |
file |
set_slice_pivot
Set a slice's pivot point, in pixels relative to the slice's top-left. This pivot is exported into the Unity ``.meta`` by export_unity_slices. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
pivot_x * | integer | |
pivot_y * | integer | |
file |
set_slice_center
Set a slice's 9-patch stretchable center rectangle (relative to the slice). One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
name * | string | |
width * | integer | |
x * | integer | |
y * | integer | |
file |
list_slices
List every slice with its bounds, pivot, and 9-patch center. Read-only. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file |
delete_slice
Delete the slice with the given name. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
file |
create_tag
Create an animation tag named ``name`` spanning frames ``from_frame``..``to_frame`` (1-based).
| Parameter | Type | Description |
|---|---|---|
from_frame * | integer | |
name * | string | |
to_frame * | integer | |
file |
delete_tag
Delete the animation tag named ``name``.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
file |
list_tags
List animation tags with their frame ranges.
| Parameter | Type | Description |
|---|---|---|
file |
rename_tag
Rename the animation tag ``old_name`` to ``new_name``. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
new_name * | string | |
old_name * | string | |
file |
set_tag_color
Set the timeline label color of the tag ``name`` (#rrggbb or #rrggbbaa). One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
name * | string | |
file |
set_tag_range
Move the tag ``name`` to span frames ``from_frame``..``to_frame`` (1-based, inclusive; validated against the sprite's frame count). One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
from_frame * | integer | |
name * | string | |
to_frame * | integer | |
file |
set_tag_direction
Set the playback direction of the tag ``name``: forward | reverse | pingpong | pingpong_reverse. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
direction * | string | |
name * | string | |
file |
create_tilemap_layer
Create a tilemap layer with its own tileset on a tile_width x tile_height grid. The new tileset starts with only tile 0, the reserved empty tile — use add_tile to append editable tiles. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
tile_height * | integer | |
tile_width * | integer | |
file |
add_tile
Append an empty tile to a tilemap layer's tileset; returns the new tile's index and the tileset size. The first added tile is index 1 (tile 0 is the reserved empty tile). One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
file |
draw_on_tile
Set pixels on one tile of a tilemap layer's tileset. ``pixels`` is a list of {x, y, color} objects (color #rrggbb or #rrggbbaa; x/y relative to the tile's top-left). Pixels outside the tile are skipped and counted. Every placed instance of the tile updates. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
pixels * | array | |
tile_index * | integer | |
file |
set_tiles
Place tile references on a tilemap layer's cel. ``tiles`` is a list of {column, row, index} objects (0-based grid cells; index 0 erases to the empty tile). The cel is created or grown as needed, anchored at the sprite origin. ``frame`` is 1-based. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
frame * | integer | |
layer * | string | |
tiles * | array | |
file |
get_tilemap_info
Read a tilemap layer: tile size, tileset length, and the cel's grid size, pixel position, and tile-index grid (``tiles`` as rows of columns, flip flags stripped; capped at 64x64 with ``truncated`` set). Read-only. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
file | ||
frame | integer |
export_tileset
Export a tilemap layer's tileset as a horizontal PNG strip (plus an Aseprite JSON atlas if ``data_path`` is given). The strip includes tile 0 (the empty tile) first, so tile index i sits at x = i * tile_width. Writes files but does not modify the sprite (it does make the layer active). Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
output_path * | string | |
data_path | ||
file |
tween_frames
Insert ``count`` in-between frames between ``from_frame`` and ``to_frame`` that slide the start frame's art toward where the end frame's art sits, so it works for moved cels and for art redrawn in a new place. It moves the art without reshaping it, and refuses if the art hasn't moved. ``easing``: linear, ease_in, ease_out, or smoothstep. Check the result with ``look_animation``. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
from_frame * | integer | |
to_frame * | integer | |
count | integer | |
easing | string | |
file | ||
layer |
tween_cel_opacity
Fade a layer's cels across [from_frame..to_frame]: opacity interpolates from ``from_opacity`` to ``to_opacity`` (0-255) with the chosen easing. Every frame in the range needs a cel on the layer. One undo step.
| Parameter | Type | Description |
|---|---|---|
from_frame * | integer | |
from_opacity * | integer | |
to_frame * | integer | |
to_opacity * | integer | |
easing | string | |
file | ||
layer |
smear_frame
Append a motion-smear frame blending ``from_frame`` and ``to_frame``: overlapping pixels averaged, single-frame areas ghosted at half alpha — a pixel-content smear. RGB sprite only. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
from_frame * | integer | |
to_frame * | integer | |
file | ||
layer |
frame_diff
Pixel-exact diff of two composited frames: changed-pixel count and ratio, the bounding box of the change, and whether they're identical. Use it to verify an animation actually moves — or that an edit didn't leak into frames it shouldn't touch. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
frame_a * | integer | |
frame_b * | integer | |
file |
render_onion_composite
Write a PNG of ``frame`` with up to ``prev`` earlier frames ghosted in red and ``next`` later frames ghosted in blue (Aseprite's onion-skin convention) at the given ghost ``opacity`` — so you can *see* the motion arc in one image. Does not modify the sprite. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
frame * | integer | |
output_path * | string | |
file | ||
next | integer | |
opacity | number | |
prev | integer |
inbetween
Fill in ``count`` frames between the key pose on ``from_frame`` and the one on the next frame, then return a picture of the result. Unlike ``tween_frames`` it handles a pose that changes shape: both poses slide toward each other and trade pixels through an ordered dither, so no new colors appear. ``smear`` makes the middle frame hold both poses at once, for fast moves. Other layers hold still. It's a first pass to draw over, not finished art. ``easing``: linear, ease_in, ease_out, or smoothstep. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
from_frame * | integer | |
count | integer | |
easing | string | |
file | ||
layer | ||
max_size | integer | |
smear | boolean |
walk_cycle_template
Lay down a timed, tagged walk or run skeleton to draw over. It adds ``frames`` frames (an even number, 4-16), or uses the sprite if it's a blank single frame, with a locked faded guide layer and an empty art layer above it, which it leaves active. The near limbs are light blue and the far limbs dark blue. Feet travel backward on the ground and swing forward through the air, so the cycle walks forward; the figure stays in place, ready for scrolling scenery or game movement. Check it with ``look_animation``, then hide or delete the guide. One undo…
| Parameter | Type | Description |
|---|---|---|
body_height * | integer | |
facing | string | |
file | ||
frames | integer | |
gait | string | |
tag |
apply_timing
Set frame durations from a preset, over a tag or a frame range (every frame by default). ``ease_in`` starts slow and speeds up, ``ease_out`` slows to a stop, ``ease_in_out`` does both, ``hold`` keeps the last frame on screen, and ``bounce`` hangs at the middle and snaps through both ends. ``base_ms`` is the quickest frame and ``strength`` how many times longer the slowest lasts. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
preset * | string | |
base_ms | integer | |
file | ||
from_frame | ||
strength | number | |
tag | ||
to_frame |
check_loop
Check whether an animation loops cleanly: compares its last frame with its first against the steps inside the loop. ``verdict`` is ``smooth``, ``jump``, ``duplicate`` (the last frame repeats the first, which stutters), ``static``, or ``pingpong``, and ``seam_bbox`` says where a jump is, ready to crop with ``look``. Compares up to 12 steps from long animations. Read-only. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file | ||
from_frame | ||
tag | ||
to_frame |
export_sprite
Export the active sprite to a file; format is chosen by ``out_path`` extension (.png, .gif, ...). A multi-frame sprite saved to a single-image format is split into ``<name>1.ext``, ``<name>2.ext``, ...; a multi-frame sprite saved to ``.gif`` becomes one animated GIF (all frames, honoring per-frame durations). The returned ``files`` lists what was actually written. Does not modify the sprite. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
out_path * | string | |
file |
export_spritesheet
Pack all frames into a single sprite-sheet image (optionally writing a JSON atlas to ``data_path``). ``sheet_type`` is rows | columns | horizontal | vertical | packed. Does not modify the sprite. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
out_path * | string | |
data_path | ||
file | ||
sheet_type | string |
export_layers
Export every image layer (recursing into groups) as its own PNG in ``out_dir``, named ``<sanitized-layer-name>.png``. Hidden layers are exported too; every layer's original visibility is restored afterwards, so the document ends exactly as it started. A multi-frame sprite splits each layer into ``<name>1.png``, ``<name>2.png``, ...; the returned ``files`` lists what was actually written. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
out_dir * | string | |
file |
export_tags
Export each animation tag's frame range as its own file in ``out_dir``: an animated ``<tag-name>.gif`` (format="gif", default) or a horizontal ``<tag-name>.png`` strip (format="png"). Errors if the sprite has no tags. Returns each tag's file, frame range, and frame count. Does not modify the sprite. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
out_dir * | string | |
file | ||
format | string |
export_unity_sprite
Export a horizontal sprite sheet AND write the Unity ``.meta`` beside it, pre-sliced into named Multiple-mode sprites (one per frame) — one action, no manual Sprite Editor pass. ``alignment`` is one of center, top_left, top, top_right, left, right, bottom_left, bottom, bottom_right, custom; ``custom`` uses ``pivot_x``/``pivot_y`` (0..1, 0,0 = bottom left). Targets Unity 2021.3+/6. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
png_path * | string | |
alignment | string | |
file | ||
pivot_x | number | |
pivot_y | number | |
pixels_per_unit | integer |
export_unity_slices
Export the sprite as a single PNG AND write a Unity ``.meta`` with one Multiple-mode sprite **per named slice**, each carrying that slice's pivot — so an atlas laid out with slices imports into Unity already sliced *and* pivoted. No competitor's Aseprite→Unity path exports pivots. Requires slices (see create_slice / set_slice_pivot). Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
png_path * | string | |
file | ||
pixels_per_unit | integer |
export_godot
Export a horizontal sprite sheet AND a Godot 4 ``SpriteFrames`` ``.tres`` beside it, with one animation per tag, keeping each frame's timing, the tag's direction, and its repeat count. No tags gives one looping ``default`` animation. Export inside a Godot project and the ``res://`` path is worked out from ``project.godot``; otherwise ``project_found`` is false and the file must sit at the project root. For sharp pixels, set the node's Texture Filter to Nearest. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
png_path * | string | |
file |
export_to_game
Export the sprite into a game project in one action, ready to select in the engine. ``game_dir`` is the project folder; it's remembered, so leave it out after the first time. Godot is detected from ``project.godot``, Unity from ``Assets`` plus ``ProjectSettings``, and any other folder gets a plain sheet. Art goes in the project's existing sprites or assets folder, or a new ``sprites`` (``Assets/Sprites`` in Unity). Godot gets a PNG, plus a ``SpriteFrames`` ``.tres`` if animated. Unity gets a PNG and a pre-sliced ``.meta``, using ``pixels_…
| Parameter | Type | Description |
|---|---|---|
file | ||
game_dir | ||
name | ||
pixels_per_unit | integer |
export_gamemaker
Write sprite strips GameMaker cuts up by itself: one ``<name>_<tag>_stripN.png`` per tag, or ``<name>_stripN.png`` with no tags. Drag them into GameMaker, or import them in its sprite editor. GameMaker gives a sprite one speed, so the result lists each strip's ``fps`` to enter there, and flags uneven timing. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
output_dir * | string | |
file | ||
name |
pack_atlas
Pack several sprites into one texture, with every frame of each, plus a JSON map in the hash layout of Aseprite's sprite-sheet export. Frames that repeat exactly share pixels. ``sprites`` are files on disk or, live, the file names of open sprites; unsaved sprites can't be named. The JSON goes beside the PNG unless ``out_json`` says otherwise, and frames are keyed ``<sprite> <index>``.
| Parameter | Type | Description |
|---|---|---|
out_png * | string | |
sprites * | array | |
out_json | ||
padding | integer |
measure_padding
Measure the transparent 'sticker' padding around the content: content bounding box, per-side padding (left/right/top/bottom), fill ratio, and distinct opaque color count. Read-only. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file |
qa_sweep
Audit the active sprite against project conventions and return per-check pass/fail. Any rule you pass is checked: exact canvas size (``expected_width``/``expected_height``), ``grid_multiple`` (canvas dims divisible by N), ``max_colors`` (distinct opaque colors ≤ N), and ``require_symmetric_padding`` (equal left/right + top/bottom margins). Read-only. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
expected_height | ||
expected_width | ||
file | ||
grid_multiple | ||
max_colors | ||
require_symmetric_padding | boolean |
find_stray_pixels
Find pixels and colors that look like accidents, and return a picture of them: the art in gray, with floating ``isolated`` pixels in red, ``orphan`` pixels (touching art but matching none of it) in yellow, and pixels of colors used ``rare`` times or fewer in magenta. Also lists ``near_duplicates``: colors within ``near`` of a much commoner one. Dithering and highlights can be deliberate orphans, so treat this as a list to look over, not to erase. Defaults to the active frame, all visible layers. Read-only. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file | ||
frame | ||
layer | ||
max_size | integer | |
near | integer | |
rare | integer |
recolor_variants
Recolor the sprite into team colors or seasons in one batch. ``variants`` maps each variant's name to a color swap, like ``{"red": {"#3050c0": "#c03030"}, "green": {"#3050c0": "#30a040"}}``. Writes one strip ``<name>_<variant>.png`` per variant into ``output_dir``, frames left to right, and returns a picture comparing them. Colors must match exactly, and any that were never found are listed in ``unmatched``. Leaves the sprite untouched. ``tag`` limits it to one animation. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
output_dir * | string | |
variants * | object | |
file | ||
name | ||
tag |
add_reference_image
Put a sketch or reference on a faded, locked layer on top of the sprite, across every frame, and keep the active layer as it was, so drawing lands on the art. ``image_path`` is a file on disk; a picture pasted into chat needs saving first. ``fit`` shrinks a larger image to the canvas. ``opacity`` is 0-255. Hide or delete the layer when done. Saving to a flat format would merge it in, so hide it first. One undo step. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
image_path * | string | |
file | ||
fit | boolean | |
layer_name | string | |
opacity | integer |
change_summary
A short list of what Claude changed this session, oldest first: each edit, how many times in a row, the frames and layers it touched, and pixels changed. Repeats on the same layer are merged. ``last`` limits it to the most recent edits. It covers the most recent 500 edits since the server started, and frames are missing for edits made with the pixel cap off, or that can't lose pixels.
| Parameter | Type | Description |
|---|---|---|
last |
explain_changes
Say which Aseprite tool, menu, or shortcut would do what Claude just did, so you pick up the technique. Covers the ``last`` most recent edits, newest repeats merged. Shortcuts are Aseprite's defaults.
| Parameter | Type | Description |
|---|---|---|
last | integer |
start_recording
Start recording this session: a picture of the active frame is kept after every edit, for ``stop_recording`` to turn into a GIF timelapse. Each picture is one more read of the sprite, so edits run a little slower while it's on. Starting again throws away what's recorded. Headless: pass ``file``.
| Parameter | Type | Description |
|---|---|---|
file | ||
max_frames | integer |
stop_recording
Stop recording and write the timelapse GIF to ``out_path``. It's zoomed with sharp pixels to fit ``max_size``, and the final picture holds for a beat before it loops. Larger GIFs take longer to encode, so raise ``max_size`` with care.
| Parameter | Type | Description |
|---|---|---|
out_path * | string | |
frame_ms | integer | |
max_size | integer |
batch_export
Export every ``.aseprite`` in ``folder`` (first frame) to an image, optionally integer-upscaled by ``scale``. Non-destructive: writes ``<name>.<format>`` to ``out_dir`` (default = ``folder``); never modifies the source. Continues past per-file errors. Headless. (``file`` is ignored — this operates on a folder.)
| Parameter | Type | Description |
|---|---|---|
folder * | string | |
file | ||
format | string | |
out_dir | ||
recursive | boolean | |
scale | integer |
batch_resize
Resize every ``.aseprite`` in ``folder`` (first frame, nearest-neighbor) and write images to ``out_dir``. Give either ``scale`` (multiplier) or explicit ``width``/``height``. Non-destructive; continues past per-file errors. Headless.
| Parameter | Type | Description |
|---|---|---|
folder * | string | |
file | ||
format | string | |
height | ||
out_dir | ||
recursive | boolean | |
scale | ||
width |
batch_apply_palette
Palette-lock every ``.aseprite`` in ``folder``: snap each sprite (first frame, alpha preserved) to a palette and export images to ``out_dir``. Give a ``preset`` (gameboy/pico8/cga) or an explicit ``palette`` list of #rrggbb. Non-destructive; continues past per-file errors. Headless.
| Parameter | Type | Description |
|---|---|---|
folder * | string | |
file | ||
format | string | |
out_dir | ||
palette | ||
preset | ||
recursive | boolean |
select_frame
Make a frame active, so the next edits land on it. Headless forgets this between calls, so use it as a step in ``edit_batch`` there.
| Parameter | Type | Description |
|---|---|---|
number * | integer | |
file |
select_layer
Make a layer active, so the next edits land on it. ``name`` may be a "Group/Layer" path. Headless forgets this between calls, so use it as a step in ``edit_batch`` there.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
file |
undo
Undo the last edit on the active sprite (live editor).
| Parameter | Type | Description |
|---|---|---|
file |
redo
Redo the last undone edit (live editor).
| Parameter | Type | Description |
|---|---|---|
file |
get_editor_state
Live editor only: current zoom, scroll, and which sprite pixel the mouse is over — lets an agent know what the artist is looking at.
set_editor_view
Live editor only: set the viewport zoom (1.0 = 100%) and/or scroll — e.g. zoom to the region you're about to edit so the artist can watch.
| Parameter | Type | Description |
|---|---|---|
scroll_x | ||
scroll_y | ||
zoom |
set_symmetry
Live editor only: set mirror-painting symmetry — ``mode`` is ``none``, ``horizontal`` (mirror across a vertical axis), ``vertical``, or ``both``; optionally place the axis lines. Affects the artist's subsequent brush strokes.
| Parameter | Type | Description |
|---|---|---|
mode * | string | |
x_axis | ||
y_axis |
ask_point
Live editor only: ask the ARTIST to click a point on the canvas (pivot, anchor, paint origin). Returns immediately; call ``get_asked_point`` to collect the click. Human-in-the-loop, in-editor.
| Parameter | Type | Description |
|---|---|---|
title | string |
get_asked_point
Poll the result of ``ask_point``: ``done`` false while waiting, then the clicked ``x``/``y`` (or ``cancelled`` if the artist pressed Esc).
cancel_ask_point
Withdraw a pending ``ask_point`` request (e.g. the artist stepped away and you're moving on).
show_choice_dialog
Live editor only: pop a small dialog IN Aseprite with a message and up to 4 option buttons (e.g. approve/redo). Non-blocking — call ``get_dialog_choice`` to collect the artist's pick.
| Parameter | Type | Description |
|---|---|---|
message * | string | |
options * | array | |
title | string |
get_dialog_choice
Poll the result of ``show_choice_dialog``: ``done`` false while the dialog is open, then the chosen button text.
watch_changes
Live editor only: start counting edits the ARTIST makes to the active sprite (via ``Sprite.events``). Poll with ``get_watched_changes`` — e.g. wait for the artist to finish touching up, then re-run the QA sweep.
get_watched_changes
Poll the change counter started by ``watch_changes`` (``reset=True`` zeroes it after reading).
| Parameter | Type | Description |
|---|---|---|
reset | boolean |
stop_watching_changes
Detach the ``watch_changes`` listener.
run_lua
Run arbitrary Lua inside Aseprite and return its result (advanced escape hatch — equivalent to local code execution). ``J(value)`` is available for JSON returns; wrap your own edits in ``app.transaction`` for clean undo. The prelude also provides ``editCel(fn)`` and ``findLayer(s, name)``. Set ``save=true`` (headless) to persist changes to ``file``. Your code must ``return`` a value. Set ``edit=true`` when the code only edits the active sprite: it then runs as one undo step, under the pixel cap and dry run. Without ``edit`` the rails do…
| Parameter | Type | Description |
|---|---|---|
code * | string | |
edit | boolean | |
file | ||
save | boolean |