Understanding sprites in Aseprite - the main container for your pixel art
A sprite is the fundamental container in Aseprite that holds all the elements of your pixel art project. It’s essentially a canvas that contains layers, frames, palettes, and all the visual data for your artwork.
In Aseprite, a sprite represents a complete document with specific dimensions, a color mode, and a collection of visual elements organized in layers and frames. Think of it as the “project file” that contains everything about your artwork.
Every sprite has a fixed width and height measured in pixels, with a maximum size of 65535×65535 pixels.
The color mode determines how pixel data is stored and displayed. See Color Modes for detailed information.
local sprite = Sprite(32, 32)print(sprite.colorMode) -- ColorMode.RGB (default)-- Color mode affects how pixels are storedlocal indexed = Sprite(32, 32, ColorMode.INDEXED)
local sprite = Sprite(32, 32)local bg = sprite.layers[1]bg:setBackground(true) -- Make it a background layerprint(sprite:isOpaque()) -- true (has visible background)
local original = Sprite(32, 32)original:newLayer()original:newLayer()-- Clone the spritelocal copy = Sprite(original)print(#copy.layers) -- Same as original
local sprite = Sprite(32, 32)-- Save as .aseprite filesprite:saveAs("myart.aseprite")-- Save as PNGsprite:saveAs("myart.png")-- Save a copy without changing the sprite's filenamesprite:saveCopyAs("backup.aseprite")