aseprite-mcp

v0.1.1
aseprite-mcp Checked 3 days ago Published 1 month ago

MCP server for Aseprite: 73 tools that drive the pixel art editor through its Lua API, headless or live in the open window.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

status

Shows the Aseprite executable in use, its version, and whether a live Aseprite is connected to the bridge.

install_extension

Copies the bridge extension into Aseprite's user extensions folder. A running Aseprite must be restarted to load it.

launch_aseprite

Starts the Aseprite GUI with the bridge extension and waits for it to connect, enabling live mode. The first time, Aseprite asks to allow the script's network and file access; tick 'Give full trust' / 'Don't show again' in that dialog.

ParameterTypeDescription
filestringOptional sprite file to open
waitSecondsnumberHow long to wait for the bridge (default 30)

run_lua

Runs Lua code inside Aseprite with the full scripting API (app, Sprite, Image, Layer, Color, ...). Globals: `args` (your args object), `sprite` (resolved sprite or app.sprite), `MCP` (helper runtime: MCP.color(), MCP.layer(spr, ref), MCP.sprite_info(spr) ...). `print` output is captured. The `return` value is sent back as JSON. Use api_docs for the API reference.

ParameterTypeDescription
code *stringLua source. Use `return` to send a value back.
argsobjectValues available to the code as `args`
backendstringauto (default): live Aseprite if connected, else headless batch
mutatesbooleanBatch mode: false skips saving the sprite afterwards (default true)
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

run_command

Executes any Aseprite menu command (app.command.<name>) with parameters, e.g. Flip, Rotate, Outline, BrightnessContrast, ColorQuantization, LinkCels, ReverseFrames, AutocropSprite. See list_commands for names and parameters. Strings like '#ff0000' become Colors; {x,y,width,height} becomes a Rectangle. ui=false is added unless allowUi is true.

ParameterTypeDescription
name *stringCommand name, e.g. 'Outline'
allowUibooleanLet the command open its dialog (live mode only)
backendstringauto (default): live Aseprite if connected, else headless batch
frameintegerFrame to make active before running
layerLayer to make active before running
mutatesbooleanBatch mode: false skips saving (default true)
paramsobjectCommand parameters
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

list_commands

Lists Aseprite commands usable with run_command, with their parameters (extracted from the Aseprite source).

ParameterTypeDescription
querystringCase-insensitive filter on name/description

api_docs

Reads the Aseprite Lua API reference (bundled from github.com/aseprite/api). Without a topic, lists topics. Topics include app, sprite, layer, cel, image, color, palette, tag, slice, tileset, selection, dialog, websocket, and command/<CommandName>.

ParameterTypeDescription
topicstringe.g. 'image', 'app', 'command/ExportSpriteSheet'

cli

Runs the Aseprite command line in batch mode (aseprite -b <args>) and returns its output. Useful for --sheet/--data exports, --split-layers, --list-tags, --save-as with {layer}/{frame} templates, --scale, --color-mode, etc. See https://www.aseprite.org/docs/cli/.

ParameterTypeDescription
args *arrayArguments after -b, e.g. ['in.aseprite', '--scale', '4', '--save-as', 'out.png']
timeoutSecondsnumber

app_state

Returns Aseprite's current state: open sprites, active sprite/layer/frame, foreground/background colors, tool, brush, timeline range and editor zoom (live).

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch

set_active

Changes what is active in the UI: sprite/layer/frame, foreground/background color, tool, brush, editor zoom, and the timeline range (selected frames/layers/colors). Mostly useful in live mode.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
bgColor'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
brushobjectBrush: built-in shape and size, or a custom image brush
fgColor'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
rangeobjectTimeline/palette selection (live only)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
toolstringTool id, e.g. pencil, eraser, paint_bucket, rectangular_marquee
zoomnumberEditor zoom factor (1 = 100%)

undo_redo

Undoes or redoes steps on a sprite (live mode; batch processes have no history between calls).

ParameterTypeDescription
action *string
backendstringauto (default): live Aseprite if connected, else headless batch
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
stepsinteger

list_preferences

Lists Aseprite preference sections and options (from pref.xml) for use with the preferences tool.

ParameterTypeDescription
sectionstringOnly this section, e.g. 'grid' or 'tool_box'

preferences

Gets or sets an Aseprite preference (app.preferences.<section>.<option>), a tool preference (tool=<id>) or a per-sprite document preference (document=true). Use list_preferences to discover names.

ParameterTypeDescription
action *string
option *stringOption name; nested options use dots, e.g. 'brush.size' with section from the tool prefs
section *string
backendstringauto (default): live Aseprite if connected, else headless batch
documentbooleanRead the sprite's document preferences
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
toolstringRead tool preferences for this tool id
value

list_sprites

Lists sprites open in Aseprite.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch

new_sprite

Creates a new sprite. In batch mode 'file' is required (the sprite is saved there).

ParameterTypeDescription
height *integer
width *integer
backendstringauto (default): live Aseprite if connected, else headless batch
backgroundFill the first layer with this color
backgroundLayerbooleanTurn the first layer into a Background layer
colorModestring
filestringSave to this path (.aseprite keeps layers/frames)
frameDurationMsinteger
framesinteger
layerNamestring
paletteColors, or {preset:'DB32'} / {file:'pal.gpl'}

open_sprite

Opens a sprite file (any format Aseprite reads: .aseprite, .png, .gif, .jpg, .webp, .bmp, .tga, .pcx, .ico, .flc, .qoi, .psd...) and returns its structure. In live mode it opens a tab.

ParameterTypeDescription
file *string
backendstringauto (default): live Aseprite if connected, else headless batch
oneFramebooleanLoad only the first frame

get_sprite_info

Returns a sprite's full structure: size, color mode, frames and durations, layer tree (with opacity, blend mode, visibility...), tags, slices, tilesets, palette size, grid, selection and active layer/frame.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
includeCelsbooleanAlso list every cel
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

save_sprite

Saves a sprite (Save / Save As), or with copy=true saves a copy without changing the sprite's file name. The extension picks the format. Single-image formats get one file per frame (name1.png, name2.png...); the result lists the files written.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
copyboolean
filestring
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

close_sprite

Closes an open sprite (live mode).

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
discardChangesboolean
saveboolean
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

set_sprite_properties

Changes sprite metadata: filename, user data, tab color, transparent color index, pixel ratio, grid bounds, user properties, color space.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
colorSpacestring
convertColorSpacebooleanConvert pixels instead of only assigning the color space
datastring
filenamestring
gridBoundsobject
pixelRatioobject
propertiesobjectUser-defined properties to set (object.properties)
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
transparentColorinteger
useLayerUuidsboolean

resize_sprite

Scales the whole sprite (all layers and frames). Give width and/or height, or scale.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
heightinteger
methodstring
savebooleanBatch mode: write changes back to the sprite file (default true)
scalenumber
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
widthinteger

canvas_size

Grows or shrinks the canvas without scaling pixels: either margins (left/top/right/bottom, negative values cut) or a new width/height with an anchor.

ParameterTypeDescription
anchorstring
backendstringauto (default): live Aseprite if connected, else headless batch
bottominteger
heightinteger
leftinteger
rightinteger
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
topinteger
trimOutsideboolean
widthinteger

crop_sprite

Crops the sprite to a rectangle, to the selection (mode='selection'), or trims empty borders (mode='auto').

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
byGridboolean
modestring
rectobject
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

change_color_mode

Converts the sprite to RGB, grayscale or indexed, with optional dithering.

ParameterTypeDescription
mode *string
backendstringauto (default): live Aseprite if connected, else headless batch
ditheringstring
ditheringFactornumber
ditheringMatrixstringe.g. 'bayer2x2', 'bayer4x4', 'bayer8x8'
fitCriteriastring
rgbmapstring
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
toGraystring

flip_rotate

Flips and/or rotates the whole sprite, the active cel(s) of a layer/frame, or the selection.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
flipstring
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
rotatenumber
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
targetstring

add_layer

Adds an image, group or tilemap layer, optionally inside a group or above/below another layer, with its properties set.

ParameterTypeDescription
abovestringPlace directly above this layer
backendstringauto (default): live Aseprite if connected, else headless batch
belowstringPlace directly below this layer
blendModestringnormal, multiply, screen, overlay, darken, lighten, color_dodge, color_burn, hard_light, soft_light, difference, exclusion, hue, saturation, color, luminosity, addition, subtract, divide
collapsedbooleanGroup layers only
colorTimeline color
continuousboolean
datastringUser data text
editablebooleanfalse locks the layer
frameintegerFrame for 'image' (default 1)
imageFill the new layer (image or reference) with this image
namestring
opacityinteger
parentstringGroup layer to move into; '' moves to the top level
propertiesobjectUser-defined properties to set (object.properties)
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
stackIndexintegerPosition among siblings (1 = bottom)
tileSizeobjectTilemap layers: tile size
typestring
visibleboolean
xintegerPosition of 'image'
yinteger

update_layer

Changes layer properties: name, visibility, lock, opacity, blend mode, color, data, parent group, stack position.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
blendModestringnormal, multiply, screen, overlay, darken, lighten, color_dodge, color_burn, hard_light, soft_light, difference, exclusion, hue, saturation, color, luminosity, addition, subtract, divide
collapsedbooleanGroup layers only
colorTimeline color
continuousboolean
datastringUser data text
editablebooleanfalse locks the layer
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
namestring
opacityinteger
parentstringGroup layer to move into; '' moves to the top level
propertiesobjectUser-defined properties to set (object.properties)
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
stackIndexintegerPosition among siblings (1 = bottom)
tilesetTilemap layers: tileset to use
visibleboolean

delete_layer

Deletes a layer (and its children if it is a group).

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

duplicate_layer

Duplicates a layer with all its cels.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
namestring
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

merge_layers

Merges a layer into the one below (mode='down'), flattens all layers ('flatten'), or flattens only visible layers ('visible').

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
modestring
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

convert_layer

Converts a layer: to a Background layer, from Background to a normal layer, or between image and tilemap layers.

ParameterTypeDescription
to *string
backendstringauto (default): live Aseprite if connected, else headless batch
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

add_frames

Adds frames. By default copies the previous frame's cels; empty=true adds blank frames.

ParameterTypeDescription
atintegerFrame number for the first new frame (default: end)
backendstringauto (default): live Aseprite if connected, else headless batch
copyFromintegerFrame to copy (default: the frame before 'at')
countinteger
durationMsinteger
emptyboolean
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

delete_frames

Deletes one frame, a range, a list, or a tag's frames.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
frameinteger1-based frame number. Defaults to the active frame (or 1).
frames'all' or a list of frame numbers
fromintegerFirst frame of a range
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstringUse the frames of this tag
tointegerLast frame of a range

set_frame_duration

Sets frame durations in milliseconds for one frame, a range, a list, a tag, or 'all'.

ParameterTypeDescription
durationMs *integer
backendstringauto (default): live Aseprite if connected, else headless batch
frameinteger1-based frame number. Defaults to the active frame (or 1).
frames'all' or a list of frame numbers
fromintegerFirst frame of a range
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstringUse the frames of this tag
tointegerLast frame of a range

move_frame

Moves a frame (with its cels) to another position.

ParameterTypeDescription
from *integer
to *integer
backendstringauto (default): live Aseprite if connected, else headless batch
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

get_cels

Lists cels (layer/frame pairs with images) with bounds, opacity, z-index and data, filtered by layer and frames.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
frameinteger1-based frame number. Defaults to the active frame (or 1).
frames'all' or a list of frame numbers
fromintegerFirst frame of a range
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstringUse the frames of this tag
tointegerLast frame of a range

update_cel

Changes a cel: position (absolute x/y or relative dx/dy), opacity, z-index, color, data, properties, or moves it to another frame.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
datastring
dxinteger
dyinteger
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
opacityinteger
propertiesobjectUser-defined properties to set (object.properties)
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
toFrameinteger
xinteger
yinteger
zIndexinteger

delete_cel

Deletes the cel(s) of a layer in the given frames.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
frameinteger1-based frame number. Defaults to the active frame (or 1).
frames'all' or a list of frame numbers
fromintegerFirst frame of a range
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstringUse the frames of this tag
tointegerLast frame of a range

copy_cel

Copies a cel's image to another layer/frame (and optionally another open sprite).

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
fromFrameinteger1-based frame number. Defaults to the active frame (or 1).
fromLayerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
fromSpriteSource sprite (default: same)
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteDestination sprite
toFrame
toLayer
xinteger
yinteger

draw_pixels

Sets individual pixels on a layer/frame (one undo step). Either 'pixels' as [[x,y,color],...] / [{x,y,color}], or pixel art as 'rows' of characters with a 'legend' mapping each character to a color; rows start at (x,y). Unmapped ' ' and '.' are skipped; map '.' to 'transparent' to erase. The cel grows as needed; pixels outside the canvas are dropped.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
blendbooleanAlpha-blend over existing pixels instead of replacing
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
legendobject
pixelsarray
rowsarray
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
xintegerLeft of the rows grid (default 0)
yintegerTop of the rows grid (default 0)

get_pixels

Reads pixels of the rendered frame (all visible layers) or of one layer. Default format 'legend' returns rows of characters plus a legend of colors ('.' = transparent); 'hex' returns a grid of '#rrggbbaa' (null = transparent). Indexed sprites return palette indices.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
formatstring
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerRead only this layer (default: the composited frame)
maxPixelsintegerSafety limit on area (default 16384)
rectobject
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

use_tool

Draws with an Aseprite tool as if the user dragged through 'points' (app.useTool). Tools: pencil, brush-like strokes with eraser/spray/blur/jumble, line, curve (4 points), rectangle, filled_rectangle, ellipse, filled_ellipse, paint_bucket (1 point), gradient, contour, polygon, and selection tools (rectangular_marquee, elliptical_marquee, lasso, polygonal_lasso, magic_wand).

ParameterTypeDescription
points *array
tool *string
backendstringauto (default): live Aseprite if connected, else headless batch
bgColor'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
brushobjectBrush: built-in shape and size, or a custom image brush
brushSizeinteger
buttonstringright uses the background color
colorDefault: foreground color
contiguousboolean
frameinteger1-based frame number. Defaults to the active frame (or 1).
inkstring
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
opacityinteger
pixelPerfectboolean
savebooleanBatch mode: write changes back to the sprite file (default true)
selectionModestring
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tilemapModestring
tilesetModestring
toleranceinteger

draw_image

Draws an image file (PNG, etc.) into a layer/frame at (x,y). mode 'blend' composites over existing pixels, 'copy' overwrites the area, 'replace' swaps the whole cel image. Optional source crop, scale or target size.

ParameterTypeDescription
file *string
backendstringauto (default): live Aseprite if connected, else headless batch
blendModestring
frameinteger1-based frame number. Defaults to the active frame (or 1).
heightinteger
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
modestring
opacityinteger
savebooleanBatch mode: write changes back to the sprite file (default true)
scalenumber
sourceRectobject
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
widthinteger
xinteger
yinteger

clear

Clears a layer's cel(s) to transparent (or fills with a color): whole cel, a rect, or the selected area.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
frameinteger1-based frame number. Defaults to the active frame (or 1).
frames'all' or a list of frame numbers
fromintegerFirst frame of a range
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
rectobject
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstringUse the frames of this tag
tointegerLast frame of a range
useSelectionboolean

replace_color

Replaces one color with another on a layer (or all layers) across frames, with optional per-channel tolerance (RGB).

ParameterTypeDescription
from *'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
to *
backendstringauto (default): live Aseprite if connected, else headless batch
frameinteger1-based frame number. Defaults to the active frame (or 1).
frames'all' or a list of frame numbers
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstringUse the frames of this tag
toleranceinteger

apply_filter

Applies an image filter command to the active cel(s) or selection: BrightnessContrast, HueSaturation, ColorCurve, ConvolutionMatrix, Despeckle, InvertColor, Outline, ReplaceColor. Params follow list_commands (e.g. Outline {color:'#000000', place:'outside', matrix:'circle'}; HueSaturation {hue, saturation, lightness, alpha}; BrightnessContrast {brightness, contrast}).

ParameterTypeDescription
filter *string
backendstringauto (default): live Aseprite if connected, else headless batch
channelsstringe.g. 'rgba', 'rgb', 'a'
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
paramsobject
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

select

Creates or changes the selection: rect, ellipse, polygon, magic_wand (point), by_color, all, none, invert, reselect, content (layer pixels), modify (expand/contract/border), move (dx/dy), get, save or load (to/from a .msk or image file). The selection lives only in live mode or inside one run_lua call.

ParameterTypeDescription
action *string
backendstringauto (default): live Aseprite if connected, else headless batch
brushstring
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
contiguousboolean
dxinteger
dyinteger
filestringsave/load: .msk (Aseprite selection file) or an image (opaque pixels = selected)
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
modestring
modifierstring
point
pointsarray
quantityinteger
rectobject
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
toleranceinteger

selection_edit

Acts on the selection: copy, copy_merged, cut, paste (optional x,y), delete, fill, stroke (with color), move_content / move_bounds (dx,dy, wrap), new_sprite, new_layer_via_copy, new_layer_via_cut, crop.

ParameterTypeDescription
action *string
backendstringauto (default): live Aseprite if connected, else headless batch
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
dxinteger
dyinteger
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
wrapboolean
xinteger
yinteger

get_palette

Returns the sprite palette as '#rrggbbaa' colors (index 0 first).

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
indexinteger
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

set_palette

Changes the palette: set colors starting at 'start', replace it entirely, resize, load from a file (.gpl, .pal, .act, .ase, .png...) or a built-in preset (e.g. DB16, DB32, PICO-8...), or generate it from the sprite's colors (fromSprite).

ParameterTypeDescription
algorithmstring
backendstringauto (default): live Aseprite if connected, else headless batch
colorsarray
filestring
fromSpritebooleanBuild a palette from the sprite (ColorQuantization)
maxColorsinteger
presetstring
replacebooleanPalette becomes exactly 'colors'
savebooleanBatch mode: write changes back to the sprite file (default true)
sizeinteger
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
startinteger
withAlphaboolean

save_palette

Saves the sprite palette to a file (.gpl, .pal, .act, .png, .ase, .hex...).

ParameterTypeDescription
file *string
backendstringauto (default): live Aseprite if connected, else headless batch
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

add_tag

Adds an animation tag over a frame range.

ParameterTypeDescription
aniDirstring
backendstringauto (default): live Aseprite if connected, else headless batch
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
datastring
frominteger
namestring
propertiesobjectUser-defined properties to set (object.properties)
repeatsinteger0 = infinite
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tointeger

update_tag

Changes a tag's name, range, direction, repeats, color or data.

ParameterTypeDescription
tag *
aniDirstring
backendstringauto (default): live Aseprite if connected, else headless batch
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
datastring
frominteger
namestring
propertiesobjectUser-defined properties to set (object.properties)
repeatsinteger0 = infinite
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tointeger

delete_tag

Deletes a tag (frames are kept).

ParameterTypeDescription
tag *
backendstringauto (default): live Aseprite if connected, else headless batch
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

add_slice

Adds a slice (with optional 9-slice center and pivot), or duplicates one with copyFrom.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
boundsobject
center9-slice center, relative to the slice; false removes it
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
copyFromSlice to duplicate
datastring
namestring
pivotPivot relative to the slice; false removes it
propertiesobjectUser-defined properties to set (object.properties)
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

update_slice

Changes a slice.

ParameterTypeDescription
slice *
backendstringauto (default): live Aseprite if connected, else headless batch
boundsobject
center9-slice center, relative to the slice; false removes it
color'#rrggbb', '#rrggbbaa', a name, a palette index, or {r,g,b,a} / {h,s,v,a} / {h,s,l,a} / {gray,a}
datastring
namestring
pivotPivot relative to the slice; false removes it
propertiesobjectUser-defined properties to set (object.properties)
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

delete_slice

Deletes a slice.

ParameterTypeDescription
slice *
backendstringauto (default): live Aseprite if connected, else headless batch
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

tileset

Tileset operations: list, add (tileSize, count), update (name, baseIndex, data), delete, add_tile, delete_tile, get_tile (pixels as rows+legend), set_tile (rows+legend or an image file). Tile index 0 is the empty tile.

ParameterTypeDescription
action *string
backendstringauto (default): live Aseprite if connected, else headless batch
baseIndexinteger
countinteger
datastring
filestring
indexintegerTile index
legendobject
namestring
propertiesobjectUser-defined properties to set (object.properties)
rowsarray
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tileSizeobject
tilesetTileset index (1-based), name, or a tilemap layer

tilemap

Reads (action 'get') or writes (action 'set') the tile indices of a tilemap layer's cel. Set with 'cells' [{col,row,tile}] or 'rows' (2D array of tile indices, -1/null to skip) starting at col/row.

ParameterTypeDescription
actionstring
backendstringauto (default): live Aseprite if connected, else headless batch
cellsarray
colinteger
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
rowinteger
rowsarray
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

draw_text

Draws text onto a layer. In live mode it uses Aseprite's text renderer with any font Aseprite knows (its built-in 'Aseprite' pixel font, or an installed system font by name such as 'Arial'). In batch mode, or with font='builtin', it uses a built-in 5x7 pixel font that can be scaled by whole numbers. Multi-line text with \n is supported.

ParameterTypeDescription
text *string
alignstringHorizontal alignment relative to x
backendstringauto (default): live Aseprite if connected, else headless batch
colorDefault black
fontstring'builtin', 'Aseprite', or a system font name (live mode)
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
letterSpacingintegerBuiltin font: pixels between letters (default 1)
lineHeightintegerOther fonts: pixels from one line to the next
lineSpacingintegerBuiltin font: pixels between lines (default 1)
measureOnlybooleanOnly return the text size, draw nothing
opacityinteger
savebooleanBatch mode: write changes back to the sprite file (default true)
scaleintegerInteger scale for the builtin font
sizenumberFont size for Aseprite/system fonts (default 6)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
xinteger
yinteger

draw_shapes

Draws vector shapes with optional antialiasing: rect, rounded_rect, oval/ellipse, line, polyline, polygon, bezier (cubic, points = start then control1, control2, end per segment), or path (ops: move/line/cubic/close). Each shape is stroked (width) or filled. Antialiasing is off by default to keep hard pixel edges. For pixel-exact aliased shapes use_tool is closer to Aseprite's own tools.

ParameterTypeDescription
shapes *array
antialiasbooleanDefault antialiasing (false)
backendstringauto (default): live Aseprite if connected, else headless batch
blendModestring
colorDefault color for shapes without one
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
opacityintegerOpacity of the whole drawing when composited
savebooleanBatch mode: write changes back to the sprite file (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
widthnumberDefault stroke width

palette_edit

Edits the palette structure: add or insert colors, remove entries, move entries, sort (by hue, saturation, value, lightness, luminance, red, green, blue, alpha), reverse a range, generate a ramp between two colors, or dedupe. In indexed sprites pixels are remapped so they keep their colors (set remapPixels=false to skip); pixels using removed colors move to the nearest remaining one.

ParameterTypeDescription
action *string
atintegerinsert/ramp: target index (default end)
backendstringauto (default): live Aseprite if connected, else headless batch
bystring
colorsarrayadd/insert
descendingboolean
fromintegerRange start for remove/move/sort/reverse
fromColorramp start
indicesarrayremove/move: entries to act on
insertbooleanramp: insert instead of overwriting entries
remapPixelsboolean
savebooleanBatch mode: write changes back to the sprite file (default true)
spacestringramp interpolation (default rgb)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
stepsinteger
tointegerRange end, or the destination index for move
toColorramp end

view_settings

Reads or changes per-sprite view settings: grid (show, snap, bounds, color, opacity), pixel grid, symmetry mode and axes, tiled mode, onion skin, overlays (layer edges, selection edges, slices, auto guides, tile numbers, brush preview), checkerboard colors; and in live mode zoom, scroll, fit to screen, playback, timeline and preview window. Call with no options to read them.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
backgroundobjectCheckerboard behind transparent pixels
fitScreenbooleanLive: zoom to fit
gridobject
onionSkinobject
pixelGridobject
playbackstringLive: start/stop animation playback (toggles)
scrollLive: sprite pixel to center the editor on
showobject
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
symmetryobject
tiledModestring
timelinebooleanLive: open (true) or close (false) the timeline
togglePreviewbooleanLive: show/hide the preview window
zoomnumberLive: editor zoom (1 = 100%)

clipboard

Reads or writes the system clipboard: info, get_text, set_text, clear, get_image (returned as a preview image, or saved to 'file'), set_image (from an image file, or a rendered sprite frame/layer/rect).

ParameterTypeDescription
action *string
backendstringauto (default): live Aseprite if connected, else headless batch
filestringget_image: save here; set_image: load from here
frameinteger1-based frame number. Defaults to the active frame (or 1).
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
rectobject
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
textstring

duplicate_sprite

Makes a copy of a whole sprite (all layers, frames, tags, slices). In batch mode 'file' is required.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
filestring
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.

properties

Gets, sets, deletes or replaces custom properties on a sprite, layer, cel, tag, slice, tileset or tile. With pluginKey ('publisher/extension') it reads/writes that extension's properties instead of the user properties.

ParameterTypeDescription
actionstring
backendstringauto (default): live Aseprite if connected, else headless batch
frameinteger1-based frame number. Defaults to the active frame (or 1).
indexintegerTile index for target=tile
keysarraydelete: property names
layerLayer name, 'Group/Child' path, or 1-based index from get_sprite_info. Defaults to the active layer.
pluginKeystring
savebooleanBatch mode: write changes back to the sprite file (default true)
slice
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tag
targetstring
tileset
valuesobject

recent_events

Live mode: returns what happened in Aseprite since a sequence number: sprite changes (including undo/redo), switching sprite/layer/frame, commands run, and color changes. Events caused by MCP calls are hidden unless includeMcp is true. Pass the returned lastSeq as 'since' next time.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
includeMcpboolean
limitinteger
sinceinteger
typesarray

ask_user

Live mode: shows a dialog in Aseprite and waits for the user to answer. Can show text plus input fields (entry, number, slider, check, combobox, color, label) and buttons. Returns the pressed button and field values.

ParameterTypeDescription
buttonsarrayDefault ['OK', 'Cancel']
fieldsarray
textstring
timeoutSecondsnumberClose the dialog and return timedOut=true after this many seconds (default 300)
titlestring

render_preview

Renders frames as an image you can look at (nearest-neighbor upscaled, transparency shown as a checkerboard). Multiple frames are laid out in a grid in frame order. Use this after edits to check the result.

ParameterTypeDescription
backendstringauto (default): live Aseprite if connected, else headless batch
checkerboardboolean
columnsinteger
cropobjectOnly this area of the rendered strip
frameinteger1-based frame number. Defaults to the active frame (or 1).
frames'all' or a list of frame numbers
fromintegerFirst frame of a range
layerRender only this layer (default: all visible layers)
maxSizeintegerLongest side of the preview (default 512)
pixelGridbooleanFaint lines between pixels at high zoom (default true)
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstringUse the frames of this tag
tointegerLast frame of a range

export

Exports a copy of the sprite to any format (png, gif, webp, jpg, bmp, tga, pcx, ico, qoi, flc, svg, css, ...). Options: scale, a tag or a 1-based frame range, a slice, specific layers, or a filename template like 'out_{frame}.png' ({frame} counts from 0). Single-image formats with several frames get one file per frame (name1.png, name2.png..., or starting from a trailing number in the name); the result lists every file written.

ParameterTypeDescription
file *string
aniDirstring
backendstringauto (default): live Aseprite if connected, else headless batch
boundsobject
filenameFormatstring
fromFrameinteger
ignoreEmptyboolean
layersarrayExport only these layers
playSubtagsboolean
scalenumber
slicestring
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstring
toFrameinteger

export_sprite_sheet

Exports a sprite sheet image plus optional JSON data (File > Export Sprite Sheet). Supports layouts, padding, trimming, extrusion, splitting by layers/tags, tilesets, and listing layers/tags/slices in the JSON.

ParameterTypeDescription
textureFilename *string
backendstringauto (default): live Aseprite if connected, else headless batch
borderPaddinginteger
columnsinteger
dataFilenamestring
dataFormatstring
extrudeboolean
filenameFormatstring
fromTilesetsboolean
heightinteger
ignoreEmptyboolean
innerPaddinginteger
layerstring
listLayersboolean
listSlicesboolean
listTagsboolean
mergeDuplicatesboolean
powerOfTwoSizeboolean
rowsinteger
shapePaddinginteger
splitGridboolean
splitLayersboolean
splitTagsboolean
spriteFile path, open tab title, or sprite id. Defaults to the active sprite (live). Batch mode needs a file path.
tagstring
tagnameFormatstring
trimboolean
trimByGridboolean
trimSpriteboolean
typestring
widthinteger

import_sprite_sheet

Opens an image and slices it into frames (File > Import Sprite Sheet). Optionally saves the result.

ParameterTypeDescription
file *string
frameHeight *integer
frameWidth *integer
backendstringauto (default): live Aseprite if connected, else headless batch
padding
partialTilesboolean
saveAsstringSave the imported sprite here (needed in batch mode)
typestring
xinteger
yinteger