--pixel-format to quantize the atlas to a lower bit depth before writing to disk.
Overview
Lower bit depths reduce file size and VRAM usage. FastPack applies Floyd-Steinberg error diffusion dithering when quantizing, which spreads quantization error across neighbouring pixels to reduce banding artefacts.Supported formats
| Format | Bits per pixel | Description |
|---|---|---|
rgba8888 | 32 | Full precision RGBA. Default; no dithering applied. |
rgb888 | 24 | 8-bit RGB with no alpha channel. |
rgb565 | 16 | 5-bit red, 6-bit green, 5-bit blue. No alpha. |
rgba4444 | 16 | 4 bits per channel with alpha. |
rgba5551 | 16 | 5-bit RGB, 1-bit alpha (threshold at 128). |
alpha8 | 8 | Alpha channel only; RGB set to zero. |
Usage
CLI flags
rgba8888
Project file configuration
Examples
Mobile UI atlas
Pack a UI atlas to RGBA4444 for a mobile target:Opaque sprite set
Pack to RGB565 for a sprite set with no transparency:Alpha mask sheet
Pack an alpha mask sheet:Technical details
Dithering algorithm
Dithering algorithm
FastPack quantizes in scan order (left to right, top to bottom). The error from each pixel is diffused to four neighbours using the standard Floyd-Steinberg weights:
Quantization method
Quantization method
Quantization uses the replication formula to expand reduced values back to 8 bits. For 5-bit red:
(r5 << 3) | (r5 >> 2). This gives the maximum and minimum correct values (255 and 0) and distributes intermediate values evenly.Processing pipeline
Processing pipeline
The dithering step runs after atlas composition and before the compressor. The output image is always RGBA8888 internally; the quantization reduces the number of unique colour values, which can improve compression ratios for PNG and JPEG even though the output stays 8 bits per channel.
RGBA5551 alpha threshold
RGBA5551 alpha threshold
rgba5551 thresholds alpha at 128: pixels at or above 128 become fully opaque (255); pixels below become fully transparent (0). Dithering is applied to the alpha channel, so pixels near the threshold may produce a mix of opaque and transparent results.Formats without dithering
Formats without dithering
rgb888 and alpha8 do not dither because they do not reduce bit depth from the source channels (RGB888 keeps 8 bits, Alpha8 keeps the 8-bit alpha exactly).