Skip to main content
Color modes determine how pixel data is stored and displayed in Aseprite. Choosing the right color mode is crucial for your artwork’s appearance, file size, and compatibility with your target platform.

Available Color Modes

Aseprite supports five color modes, each with different characteristics and use cases:
ColorMode.RGB        -- 32-bit RGBA (4 bytes per pixel)
ColorMode.GRAYSCALE  -- 16-bit grayscale with alpha (2 bytes per pixel)
ColorMode.INDEXED    -- 8-bit indexed color (1 byte per pixel)
ColorMode.BITMAP     -- 1-bit black and white (1 byte per pixel)
ColorMode.TILEMAP    -- Tile indices (4 bytes per pixel)

RGB Color Mode

RGB (also called RGBA) stores full color information with alpha transparency.
RGB is the default color mode for new sprites and is best for modern games and applications.

Characteristics

  • Storage: 4 bytes per pixel (Red, Green, Blue, Alpha)
  • Colors: 16.7 million colors + 256 levels of transparency
  • Bit depth: 32-bit (8 bits per channel)
  • Best for: Modern pixel art, full-color artwork, web graphics

Creating RGB Sprites

-- RGB is the default
local sprite = Sprite(32, 32)
print(sprite.colorMode)  -- ColorMode.RGB

-- Explicit RGB mode
local sprite = Sprite(32, 32, ColorMode.RGB)

-- RGB with named parameters
local sprite = Sprite{
  width = 64,
  height = 64,
  colorMode = ColorMode.RGB
}

Working with RGB Colors

local sprite = Sprite(32, 32, ColorMode.RGB)
local image = sprite.cels[1].image

-- Set pixel with full RGBA
image:drawPixel(10, 10, Color{r=255, g=128, b=64, a=255})

-- Semi-transparent pixel
image:drawPixel(11, 10, Color{r=255, g=0, b=0, a=128})

-- RGB mode supports alpha blending
print(sprite:needAlpha())     -- true
print(sprite:supportAlpha())  -- true

Indexed Color Mode

Indexed mode uses a palette of up to 256 colors. Each pixel stores an index to the palette instead of the actual color.

Characteristics

  • Storage: 1 byte per pixel (palette index)
  • Colors: Up to 256 colors from palette
  • Bit depth: 8-bit indices
  • Best for: Retro games, limited palettes, small file sizes

Creating Indexed Sprites

-- Create indexed sprite with default 256-color palette
local sprite = Sprite(32, 32, ColorMode.INDEXED)
print(sprite.colorMode)  -- ColorMode.INDEXED

-- Check palette
local palette = sprite.palettes[1]
print(#palette)  -- 256 (default size)

-- Create with custom palette size
local sprite = Sprite(32, 32, ColorMode.INDEXED)
local pal = Palette(16)  -- 16-color palette
sprite:setPalette(pal)

Working with Indexed Colors

local sprite = Sprite(32, 32, ColorMode.INDEXED)
local image = sprite.cels[1].image
local palette = sprite.palettes[1]

-- Set palette colors
palette:setColor(0, Color(0, 0, 0))       -- Black
palette:setColor(1, Color(255, 255, 255)) -- White
palette:setColor(2, Color(255, 0, 0))     -- Red
palette:setColor(3, Color(0, 255, 0))     -- Green

-- Draw using palette indices
image:drawPixel(10, 10, 2)  -- Red (index 2)
image:drawPixel(11, 10, 3)  -- Green (index 3)

-- Transparent color
print(sprite.transparentColor)  -- 0 (default)
sprite.transparentColor = 1     -- Index 1 is now transparent

Indexed Mode Benefits

Indexed mode uses 1/4 the memory of RGB mode, making it ideal for:
  • Retro game development
  • Large tile-based levels
  • Games with many sprites loaded simultaneously
Change all colors instantly by modifying the palette:
-- Change red to blue throughout entire sprite
palette:setColor(2, Color(0, 0, 255))
Perfect for emulating classic systems:
  • NES: 54 colors
  • Game Boy: 4 colors
  • SEGA Genesis: 512 colors, 64 per palette

Grayscale Color Mode

Grayscale stores luminance and alpha values without color information.

Characteristics

  • Storage: 2 bytes per pixel (Gray value, Alpha)
  • Colors: 256 levels of gray + 256 levels of transparency
  • Bit depth: 16-bit (8 bits gray, 8 bits alpha)
  • Best for: Black and white art, masks, grayscale graphics

Creating Grayscale Sprites

local sprite = Sprite(32, 32, ColorMode.GRAYSCALE)
print(sprite.colorMode)  -- ColorMode.GRAYSCALE

Working with Grayscale

local sprite = Sprite(32, 32, ColorMode.GRAYSCALE)
local image = sprite.cels[1].image

-- Set grayscale pixel (value, alpha)
image:drawPixel(10, 10, Color{gray=255, alpha=255})  -- White
image:drawPixel(11, 10, Color{gray=128, alpha=255})  -- 50% gray
image:drawPixel(12, 10, Color{gray=0, alpha=255})    -- Black

-- Semi-transparent gray
image:drawPixel(13, 10, Color{gray=128, alpha=128})

Bitmap Color Mode

Bitmap mode stores only black or white pixels, using 1 bit per pixel.

Characteristics

  • Storage: 1 byte per pixel (effectively 1 bit, but stored as byte)
  • Colors: 2 colors (black and white only)
  • Bit depth: 1-bit
  • Best for: 1-bit art, dithering effects, extreme minimalism

Creating Bitmap Sprites

local sprite = Sprite(32, 32, ColorMode.BITMAP)
print(sprite.colorMode)  -- ColorMode.BITMAP

Working with Bitmap

local sprite = Sprite(32, 32, ColorMode.BITMAP)
local image = sprite.cels[1].image

-- Only 0 (black) and 1 (white) are valid
image:drawPixel(10, 10, 1)  -- White
image:drawPixel(11, 10, 0)  -- Black

-- No alpha channel in bitmap mode
print(sprite:needAlpha())  -- false

Tilemap Color Mode

Tilemap mode stores tile indices instead of direct pixel colors. See tilemap documentation for details.

Characteristics

  • Storage: 4 bytes per pixel (tile index + flags)
  • Purpose: Reference tiles from a tileset
  • Best for: Tile-based games, efficient level design
-- Check if layer uses tilemap mode
if layer:isTilemap() then
  print("This layer uses tilemap mode")
end

Choosing the Right Color Mode

Use RGB when...

  • Creating modern pixel art
  • Need full color range
  • Need smooth gradients
  • Targeting web or modern platforms
  • Using alpha transparency extensively

Use Indexed when...

  • Making retro-style games
  • Need palette swaps
  • Working with color limitations
  • Optimizing file size
  • Emulating classic systems

Use Grayscale when...

  • Creating black and white art
  • Making alpha masks
  • Need smaller files than RGB
  • Working with monochrome displays

Use Bitmap when...

  • Creating 1-bit art
  • Maximum file size optimization
  • Emulating ancient systems
  • Creating dithered effects

Converting Between Color Modes

You can convert sprites between color modes:
local sprite = Sprite(32, 32, ColorMode.RGB)

-- Convert to indexed
sprite:setPixelFormat(ColorMode.INDEXED)
print(sprite.colorMode)  -- ColorMode.INDEXED

-- Convert to grayscale
sprite:setPixelFormat(ColorMode.GRAYSCALE)
print(sprite.colorMode)  -- ColorMode.GRAYSCALE
Converting color modes may result in data loss:
  • RGB → Indexed: Colors quantized to palette
  • RGB → Grayscale: Color information lost
  • Any → Bitmap: Reduced to black/white only
Always keep a backup before converting!

Color Mode Properties

Memory Usage Comparison

For a 64×64 pixel sprite:
Color ModeBytes/PixelTotal MemoryRelative Size
RGB416,384 bytes100%
Grayscale28,192 bytes50%
Indexed14,096 bytes25%
Bitmap14,096 bytes25%
Tilemap416,384 bytes100%

Alpha Support

local rgbSprite = Sprite(32, 32, ColorMode.RGB)
print(rgbSprite:supportAlpha())  -- true
print(rgbSprite:needAlpha())     -- true (unless has background)

local indexedSprite = Sprite(32, 32, ColorMode.INDEXED)
print(indexedSprite:supportAlpha())  -- true (via transparent index)
print(indexedSprite:needAlpha())     -- true (unless has background)

local bitmapSprite = Sprite(32, 32, ColorMode.BITMAP)  
print(bitmapSprite:supportAlpha())  -- false
print(bitmapSprite:needAlpha())     -- false

Best Practices

Select your color mode before you begin drawing. Converting later can result in quality loss.
Research your target platform’s capabilities:
  • Modern web: RGB
  • Retro consoles: Indexed (check system palette limits)
  • Game Boy: Grayscale or 4-color Indexed
  • PC games: Usually RGB
If targeting Indexed mode, work with your final palette from the start to see how colors interact.
For games loading many sprites:
  • Indexed: Best compression
  • Grayscale: Good compression
  • RGB: Larger files
  • Bitmap: Smallest files

Palettes

Deep dive into palette management

Sprites

Learn about sprite creation

API Reference

For complete API documentation, see: