apply
Run multiple sprite edit operations as one transaction: if any op fails, nothing saves and the error names the failing op. Use dry_run to validate changes before writing.
Instructions
Run edit operations on a sprite as ONE transaction: if any op fails nothing is saved and the error names the op. ops_list items are {"op": name, ...arguments}. Frames are 1-based; drawing ops take frame (one) or frames (list, "all", "2-6", "1,3,5-8"); layer defaults to the top image layer. Pixels drawn past the canvas edge are kept in the cel, never clipped. dry_run=true runs everything and reports, but saves nothing.
Ops (name(arguments), ? = optional): add_frames(count?=1, at? (1-based position to insert before; default: append), duration?=100, copy_from?) add_group(name, group?) add_layer(name, group?, opacity?=255, blend?=normal, visible?=true, reference?=false) add_slice(name, x, y, w, h, frame?=1, pivot? [x,y], center? [x,y,w,h], data?) add_tag(name, from, to, direction?=forward, repeat?=0 (0 = loop forever), color?) blink_flash(layer?, frames, color?=#ffffff (white flash) — alternates flash on/off across the frames) clean(specks?=2 (max size of detached islands to delete), orphans?=true, protect? [colors], layer?, frames?) clear(layer?, frames?, region? [x,y,w,h]) copy_cel(layer, from, to (frames), to_layer?, linked?=false, dx?=0, dy?=0) curve(points (3 = quadratic, 4 = cubic Bezier control points), color, layer?, frames?) damage_number(text, x, y (where it pops: its bottom centre), frames, rise?=10, layer?=damage, color?=#fff1a8, bottom_color?=#ff5a3c, outline?=#3a0c14, font?=bold, pop?=true, fade_frames?=2) duplicate_frame(frame, linked?=false) duplicate_layer(layer, name) ellipse(x, y, w, h (bounding box, even sizes fine), color, fill?=true, layer?, frames?, lock_alpha?) erase(x, y, w, h, layer?, frames?) fade(layer, frames, from?=255, to?=0, ease?=linear) fill(x, y, color, tolerance?=0, diagonal?=false, layer?, frames?) fix_glitches(kinds?=[stray, spur, hole, cut, block], master_frame?=1, master_frames? (key drawings), layer?, frames?) flash(color?=#ffffff, amount?=1.0 (1 = solid silhouette), layer?, frames? (hit flash)) flip(axis?=h|v, center? (canvas x for h, y for v; default canvas middle), layer?, frames?) line(x0, y0, x1, y1, color, perfect?=true, layer?, frames?, lock_alpha?) link_cels(layer, source (frame), frames) map(rows (one string per row), legend {char: color}, x?=0, y?=0, layer?, frames?, lock_alpha? ('.' = leave)) move_cel(layer, dx, dy, frames?) move_frame(frame, to) move_layer(layer, to (1 = bottom among its siblings)) outline(color, where?=outside|inside, diagonal?=false, layer?, frames?) palette_lock(palette? [colors] or source? (.aseprite/.png whose colours to use), layer?, frames?) pixels(points [[x,y],...] or [[x,y,color],...], color?, layer?, frames?, lock_alpha?) polyline(points [[x,y],...], color, closed?=false, perfect?=true, layer?, frames?) rect(x, y, w, h, color, fill?=false, layer?, frames?, lock_alpha?) remap(mapping {from_color: to_color}, tolerance?=0, layer?, frames?) remove_frames(frames) remove_layer(layer) remove_slice(name) remove_tag(name) replace_color(from, to, tolerance?=0, layer?, frames?) reverse_frames(frames (an unbroken range)) rotate(degrees (clockwise), pivot [x,y] (canvas), method?=rotsprite|nearest, layer?, frames?) scale(factor (or sx, sy), anchor?=topleft|center|bottom, layer?, frames? (nearest neighbour)) seal_cuts(master_frame?=1, color? (default: the master's darkest colour), layer?, frames? (outline what animating cut open)) set_cel(layer, frames?, opacity?, z?) set_duration(ms, frames?=all) set_durations(durations (list of ms, one per frame from frame 1)) set_layer(layer, name?, opacity?, blend?, visible?, editable?) set_palette(colors [list], replace?=true) shake(layer, frames, amplitude?=1, axis?=x|y|both) squash_stretch(amount (0.2 = squash 20%, -0.2 = stretch), anchor?=bottom|top|left|right, layer?, frames?) stamp(source (png/aseprite path), x?=0, y?=0, source_frame?=1, source_layer?, blend?=true, layer?, frames?) text(text, x, y, color, font?=tiny|bold, bottom_color?, outline?, shadow?, scale?=1, anchor?=topleft|center|bottom|topright, layer?, frames?) tween_move(layer, frames (in order), dx?, dy?, ease?=linear|ease_in|ease_out|ease_in_out|back_out, arc?=0) unlink_cels(layer, frames)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| dry_run | No | ||
| ops_list | Yes |