Creates an empty file with the given canvas size and color mode.
Color mode.
Color profile, if set.
All external file references.
Raw header flags (bit 1: layer opacity is valid; bit 2: group opacity/blend valid; bit 4: layers have a UUID).
All frames.
Grid overlay settings.
Canvas height in pixels.
All layers, in document order (bottom to top).
Legacy mask chunks (deprecated in modern Aseprite).
Color palette (empty if the file had no palette chunk).
Pixel aspect ratio.
All slices.
Sprite-level user data, if set.
All animation tags.
All tilesets.
Transparent palette index (only meaningful in indexed color mode).
Canvas width in pixels.
Adds a frame with the given duration in milliseconds. Returns the frame index.
Adds a group layer, at the top level or nested inside parent.
Optionalopts: LayerOptions & { parent?: GroupRef }Adds a normal layer, at the top level or inside parent.
Optionalopts: LayerOptions & { parent?: GroupRef }Adds an animation tag over the inclusive frame range [from, to]. Returns the tag index.
Adds a tilemap layer referencing the tileset at tilesetIndex.
Optionalopts: LayerOptions & { parent?: GroupRef }Returns the raw cel at a layer/frame, or undefined. May be a 'linked' cel; see resolveCel.
Iterates over all cels, ordered by layer index and then frame index.
Removes the cel at a layer/frame. Returns whether a cel was removed.
Sets the pixel content of a layer/frame (zlib-compressed unless opts.raw is set).
Makes the cel at frame a link to the cel at sourceFrame on the same layer.
Sets the pixel aspect ratio.
Sets tilemap content for a tilemap layer/frame. tiles holds width * height
32-bit tile entries (tile ID in the low 29 bits, then X/Y/diagonal flip bits).
Sets the transparent palette index.
Serializes the file to Aseprite binary format.
Optionaloptions: WriteOptionsStaticreadParses bytes, bounded by default read limits or the supplied limit overrides.
Optionallimits: Partial<ReadLimits>
An Aseprite
.ase/.asepritefile.Example: Reading
Example: Creating