SCHEMAXIS · Declared work. Results you can check.Documentation ↗ · Contact
schemaxis/Agent’s Hands

Documentation / generated/aseprite-operations.md
Core 11629ae · View or edit Markdown on GitHub ↗

Aseprite operation reference

Generated from the current declarations. Do not edit this file by hand.

Types, limits and defaults below describe resolved values. Runtime expressions must produce these types. Unknown options are rejected; defaults apply only when omitted. Constructor options must be constant after document composition.

Index#

circle, frame, importImage, layer, palette, pixel, rect, sprite, tag

circle#

Fills a raster disc centred on pixel (x, y): every pixel whose squared distance from the centre is at most radius squared, on a named layer and frame. Radius 0 draws a single pixel. Pixels are replaced, not blended: an opaque colour overwrites the selected layer and frame, and transparent [0, 0, 0, 0] erases. Choose it for round shapes and, with a transparent colour, for round cut-outs.

Common mistakes and assumptions:

  • The full square from (x - radius, y - radius) to (x + radius, y + radius) must fit in the canvas, so a disc cannot touch beyond the edge. It must take its sprite input from the immediately preceding node.
  • The disc always has an odd diameter (2 x radius + 1 pixels); an even-width circle is not possible.

Native binding: Image:drawPixel. Output kind: ["sprite"].

Input port Multiplicity Required Kind
sprite one node yes sprite
Option Meaning Type / constraints Default
layer Name of the existing layer the circle is drawn on: the sprite's first layer (default "base") or a layer added by an earlier layer node. {"type":"string","minLength":1,"maxLength":64} required
frame One-based number of the frame the circle is drawn on: 1 is the sprite's first frame, 2 the frame added by the first frame node, and so on. Only that frame changes. {"type":"integer","minimum":1,"maximum":32} 1
x Zero-based column of the disc's centre pixel. The disc spans columns x - radius to x + radius, so x must be at least radius and at most canvas width - 1 - radius. {"type":"integer","minimum":0,"maximum":255} required
y Zero-based row of the disc's centre pixel. The disc spans rows y - radius to y + radius, so y must be at least radius and at most canvas height - 1 - radius. {"type":"integer","minimum":0,"maximum":255} required
colour RGBA colour written to every pixel of the circle: an opaque colour with alpha 255 replaces the pixels, and [0, 0, 0, 0] erases them to transparency. Colours are stored directly as RGB values and need not be in the palette. {"type":"array","items":{"type":"integer","minimum":0,"maximum":255,"required":true},"minItems":4,"maxItems":4} required
radius Radius of the disc in whole pixels (0 to 127). A pixel at offset (dx, dy) from the centre is filled when dx squared plus dy squared is at most radius squared, so the disc is 2 x radius + 1 pixels across and radius 0 draws one pixel. {"type":"integer","minimum":0,"maximum":127} required

frame#

Appends one new empty animation frame after the last frame, with its own display duration. Choose it to build an animation; frames are numbered from 1 in the order they are added, and every layer is transparent in the new frame until drawing nodes with that frame number paint it. Each frame becomes one cell of the horizontal sheet.png.

Common mistakes and assumptions:

  • Nothing is copied from the previous frame; redraw the background on the new frame (as the animation example does).
  • At most 32 frames, and the sheet width (canvas width x frames) may not exceed 8192 pixels. It must take its sprite input from the immediately preceding node.

Native binding: Sprite:newEmptyFrame. Output kind: ["sprite"].

Input port Multiplicity Required Kind
sprite one node yes sprite
Option Meaning Type / constraints Default
durationMS Display time of the new frame in milliseconds (1 to 65535), saved in sprite.aseprite and listed in sheet.json. Unequal durations let one frame hold longer than others. {"type":"integer","minimum":1,"maximum":65535} 100

importImage#

Place captured PNG artwork into an existing named layer and frame at integer canvas coordinates. Choose this to turn prepared raster assets into editable cels while retaining procedural drawing and animation tags. The declared image rectangle replaces existing pixels in that cel, including transparent pixels which erase; transparent top-layer pixels reveal lower layers in the flattened preview. Captures, reopened cels and both PNG publications are independently checked sample by sample.

Common mistakes and assumptions:

  • Only metadata-free, noninterlaced RGBA8 PNG with alpha 0 or 255 is supported. Strip profiles/metadata; no scaling, clipping, colour conversion, arbitrary paths in Lua or authored scripts.
  • Plan checks declared dimensions and placement; execution checks actual captured PNG dimensions and samples. Original source paths are never opened by the native worker.

Native binding: Image{fromFile}; Sprite:newCel; Cel.image. Output kind: ["sprite"].

Input port Multiplicity Required Kind
sprite one node yes sprite
Option Meaning Type / constraints Default
source Absolute local .png file path to capture before native execution. Required; no default. The source must be a regular file within 2 MiB and contain only IHDR/IDAT/IEND, RGBA8 samples, no interlace and binary alpha. The capture keeps original bytes and SHA-256; transparent hidden RGB is discarded for sample comparisons. {"type":"string","minLength":1,"maxLength":4096} required
layer Existing layer name receiving the pixels. Required; case sensitive. Create the named layer earlier; opaque pixels on later layers cover lower artwork in the preview. {"type":"string","minLength":1,"maxLength":64} required
frame One-based existing animation frame receiving the cel pixels. Omitted means 1; a frame node must precede an import into any later frame. Importing creates an absent cel but never a frame. {"type":"integer","minimum":1,"maximum":32} 1
x Zero-based canvas column of the image left edge, in pixels, increasing rightward. Required; x+width must fit the canvas. No clipping or negative placement. {"type":"integer","minimum":0,"maximum":255} required
y Zero-based canvas row of the image top edge, in pixels, increasing downward. Required; y+height must fit the canvas. No clipping or negative placement. {"type":"integer","minimum":0,"maximum":255} required
width Required source image width in pixels, 1 to 256. The captured PNG must have this exact width; this is a dimension assertion, never a resize instruction. {"type":"integer","minimum":1,"maximum":256} required
height Required source image height in pixels, 1 to 256. The captured PNG must have this exact height; this is a dimension assertion, never a resize instruction. {"type":"integer","minimum":1,"maximum":256} required

layer#

Adds a new, empty, visible image layer with normal blending on top of all existing layers. Choose it to keep parts of the artwork separately editable in Aseprite, such as a background and a foreground; in the flattened preview and sheet, opaque pixels on later layers cover those on earlier layers. Drawing nodes select the layer by its name.

Common mistakes and assumptions:

  • At most 16 layers in total, including the sprite's initial layer; names must be unique.
  • It must take its sprite input from the immediately preceding node.

Native binding: Sprite:newLayer. Output kind: ["sprite"].

Input port Multiplicity Required Kind
sprite one node yes sprite
Option Meaning Type / constraints Default
name Name of the new layer, 1 to 64 characters. Drawing nodes select the layer by this exact name, and the name is kept in sprite.aseprite for editing in Aseprite. {"type":"string","minLength":1,"maxLength":64} required

palette#

Replaces the sprite's whole palette with the listed RGBA colours, in order. Because Schemaxis sprites use RGB colour mode, the palette is saved in sprite.aseprite as the colour swatches offered when editing in Aseprite; it does not recolour existing pixels and does not restrict which colours drawing nodes may use.

Common mistakes and assumptions:

  • Changing a palette entry never changes pixels already drawn; change the colour of the drawing nodes instead.
  • It must take its sprite input from the immediately preceding node.

Native binding: Sprite:setPalette. Output kind: ["sprite"].

Input port Multiplicity Required Kind
sprite one node yes sprite
Option Meaning Type / constraints Default
colours The complete new palette: 1 to 256 RGBA entries saved in order as indices 0, 1, 2 and so on, replacing the previous palette. In RGB colour mode these are swatches only; drawing colours need not appear in it. {"type":"array","items":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255,"required":true},"minItems":4,"maxItems":4,"required":true},"minItems":1,"maxItems":256} required

pixel#

Sets exactly one pixel at zero-based column x and row y (origin at the top-left) on a named layer and frame. Pixels are replaced, not blended: an opaque colour overwrites the selected layer and frame, and transparent [0, 0, 0, 0] erases. Choose it for highlights, outlines and single details; use rect or circle for filled areas.

Common mistakes and assumptions:

  • The layer and frame must already exist at this point of the chain; otherwise planning fails with INVALID_DRAW. It must take its sprite input from the immediately preceding node.

Native binding: Image:drawPixel. Output kind: ["sprite"].

Input port Multiplicity Required Kind
sprite one node yes sprite
Option Meaning Type / constraints Default
layer Name of the existing layer the pixel is drawn on: the sprite's first layer (default "base") or a layer added by an earlier layer node. {"type":"string","minLength":1,"maxLength":64} required
frame One-based number of the frame the pixel is drawn on: 1 is the sprite's first frame, 2 the frame added by the first frame node, and so on. Only that frame changes. {"type":"integer","minimum":1,"maximum":32} 1
x Zero-based column of the pixel, counted from the left edge; it must be less than the canvas width. {"type":"integer","minimum":0,"maximum":255} required
y Zero-based row of the pixel, counted from the top edge; it must be less than the canvas height. {"type":"integer","minimum":0,"maximum":255} required
colour RGBA colour written to the selected pixel: an opaque colour with alpha 255 replaces the pixels, and [0, 0, 0, 0] erases them to transparency. Colours are stored directly as RGB values and need not be in the palette. {"type":"array","items":{"type":"integer","minimum":0,"maximum":255,"required":true},"minItems":4,"maxItems":4} required

rect#

Fills an axis-aligned rectangle of width x height pixels whose top-left pixel is at (x, y), covering columns x to x + width - 1 and rows y to y + height - 1, on a named layer and frame. Pixels are replaced, not blended: an opaque colour overwrites the selected layer and frame, and transparent [0, 0, 0, 0] erases. Choose it for backgrounds, panels and blocks; a full-canvas rect is the usual way to give a frame an opaque background.

Common mistakes and assumptions:

  • The whole rectangle must lie inside the canvas (x + width and y + height at most the canvas size); it is rejected, not clipped. It must take its sprite input from the immediately preceding node.

Native binding: Image:drawPixel. Output kind: ["sprite"].

Input port Multiplicity Required Kind
sprite one node yes sprite
Option Meaning Type / constraints Default
layer Name of the existing layer the rectangle is drawn on: the sprite's first layer (default "base") or a layer added by an earlier layer node. {"type":"string","minLength":1,"maxLength":64} required
frame One-based number of the frame the rectangle is drawn on: 1 is the sprite's first frame, 2 the frame added by the first frame node, and so on. Only that frame changes. {"type":"integer","minimum":1,"maximum":32} 1
x Zero-based column of the rectangle's left edge; it covers columns x to x + width - 1. {"type":"integer","minimum":0,"maximum":255} required
y Zero-based row of the rectangle's top edge; it covers rows y to y + height - 1, extending downwards. {"type":"integer","minimum":0,"maximum":255} required
colour RGBA colour written to every pixel of the rectangle: an opaque colour with alpha 255 replaces the pixels, and [0, 0, 0, 0] erases them to transparency. Colours are stored directly as RGB values and need not be in the palette. {"type":"array","items":{"type":"integer","minimum":0,"maximum":255,"required":true},"minItems":4,"maxItems":4} required
width Number of columns the rectangle covers, from x to x + width - 1 (1 to 256). x + width must not exceed the canvas width. {"type":"integer","minimum":1,"maximum":256} required
height Number of rows the rectangle covers, from y downwards to y + height - 1 (1 to 256). y + height must not exceed the canvas height. {"type":"integer","minimum":1,"maximum":256} required

sprite#

Starts every Aseprite document: creates a new RGB sprite canvas of width x height pixels with one transparent frame, one normal image layer and an initial palette. It must be the first node and appear only once; every later operation modifies this same sprite in sequence. The finished sprite is published as editable sprite.aseprite, preview.png (first frame), sheet.png (all frames in a row) and sheet.json (frame rectangles, durations and tags).

Common mistakes and assumptions:

  • Choose the canvas size first: drawing nodes are checked against it, and the canvas cannot be resized later in the chain.
  • Larger canvases leave less room for layers and frames: width x height x frames x layers may not exceed 262144 (a 256 x 256 canvas allows only four layer-frame cels in total). Native acceptance covers the bundled icon and two-layer, two-frame animation examples with Aseprite 1.3.x in batch mode; it does not review GUI appearance.

Native binding: Sprite. Output kind: ["sprite"].

Inputs: none.

Option Meaning Type / constraints Default
width Canvas width in pixels (1 to 256). Every frame and layer has this width, drawing x coordinates must stay below it, and sheet.png is width x number of frames pixels wide. {"type":"integer","minimum":1,"maximum":256} required
height Canvas height in pixels (1 to 256). Every frame and layer has this height, and drawing y coordinates (counted downwards from the top row 0) must stay below it. {"type":"integer","minimum":1,"maximum":256} required
layer Name given to the sprite's first (bottom) image layer. Drawing nodes refer to this name to paint on it; later layer nodes stack above it. {"type":"string","minLength":1,"maxLength":64} "base"
durationMS Display time of frame 1 in milliseconds (1 to 65535), saved as the frame duration in sprite.aseprite and listed in sheet.json. Later frames get their own durations from frame nodes. {"type":"integer","minimum":1,"maximum":65535} 100
colours Initial palette: 1 to 256 RGBA entries saved in order as palette indices 0, 1, 2 and so on. In RGB colour mode the palette only provides editing swatches; it neither limits nor changes the colours drawn. A later palette node replaces it. {"type":"array","items":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255,"required":true},"minItems":4,"maxItems":4,"required":true},"minItems":1,"maxItems":256} [[0,0,0,0],[255,255,255,255]]

tag#

Names an inclusive range of existing frames and records its playback direction as an Aseprite animation tag. Tags change no pixels; they are saved in sprite.aseprite and listed in sheet.json so that a game engine or an artist in Aseprite can play that sequence. Choose it to label animations such as walk or blink when the sprite has several frames.

Common mistakes and assumptions:

  • Add the tag after the frame nodes it covers: toFrame may not exceed the number of frames created so far.
  • Schemaxis's FFmpeg sheet encoding keeps tags as metadata only; they do not select or reorder video playback. It must take its sprite input from the immediately preceding node.

Native binding: Sprite:newTag. Output kind: ["sprite"].

Input port Multiplicity Required Kind
sprite one node yes sprite
Option Meaning Type / constraints Default
name Name of the animation tag, 1 to 64 characters, as shown in Aseprite's timeline and listed in sheet.json for engines that select animations by name. {"type":"string","minLength":1,"maxLength":64} required
fromFrame One-based number of the first frame in the tag; the range is inclusive and fromFrame must not exceed toFrame. {"type":"integer","minimum":1,"maximum":32} required
toFrame One-based number of the last frame in the tag, included in the range. It must be at least fromFrame and no greater than the number of frames created before this tag node. {"type":"integer","minimum":1,"maximum":32} required
direction Playback direction stored with the tag (Aseprite's Animation Direction): forward plays fromFrame to toFrame; reverse plays toFrame back to fromFrame; pingPong plays forward then backward and repeats; pingPongReverse is ping-pong that starts with the backward pass. It is metadata for players such as Aseprite or a game engine; Schemaxis renders no animation. {"type":"enum","values":["forward","reverse","pingPong","pingPongReverse"]} "forward"