Animated image guide
Rebuild GIF and APNG animations as Aseprite frames
Compare GIF and APNG decoding, frame timing, transparency, disposal, and compositing when rebuilding a flat Aseprite timeline.
GIF and APNG are animated rendered formats. They describe how full or partial pixel rectangles appear over time, including timing and compositing instructions. They do not contain the original editor layers used to author those rendered frames.
The shared output model
Both importers produce a full-canvas RGBA snapshot for every accepted animation frame. The snapshots become cels on one generated layer named “Main.” Offsets, transparency, blending, and disposal are resolved during decoding so the Aseprite timeline shows the displayed result for each moment.
Disposal affects the working canvas prepared for the next frame. It does not erase the snapshot already saved for the current frame.
GIF-specific behavior
The project owns a deterministic GIF89a block parser, LZW decoder, and compositor. It does not depend on timer-driven browser image capture. The supported subset allows global or local color tables, non-interlaced image rectangles, transparency, and disposal methods 0 through 3. The first image must cover the full logical screen; later frames may be smaller and offset.
GIF delay units are hundredths of a second. A missing or zero delay becomes 100 ms. Positive values are multiplied by 10 and clamped to 20–65,535 ms. Identical frames remain separate; loop metadata is validated but not copied because SpriteProject has no loop-count field.
- Disposal 0 or 1 keeps the canvas for the next frame.
- Disposal 2 clears the current rectangle to transparency or the validated logical-screen background, depending on the control data.
- Disposal 3 restores the pre-draw canvas.
- Reserved disposal values, interlacing, user-input timing, plain-text extensions, malformed LZW streams, and ambiguous bounds are rejected.
APNG-specific behavior
The APNG path validates PNG chunks, CRCs, sequence numbers, frame bounds, and a deliberately narrow RGBA8 non-interlaced structure. The first frame must be the default image and cover the canvas. Later frame rectangles can be offset. The importer reverses PNG filters, inflates bounded frame data locally, and applies APNG source or over blending with straight-alpha math.
APNG delays use delay_num / delay_den seconds; a zero denominator means 100. Values are rounded to the nearest millisecond and clamped to 1–65,535 ms. Disposal may keep the result, clear the rectangle to transparent, or restore its exact pre-draw contents. A static PNG without animation control is rejected in APNG mode so frames are never silently discarded.
| Behavior | GIF | APNG |
|---|---|---|
| Color representation | Indexed palettes decoded to RGBA | RGBA8 pixels in the accepted subset |
| Timing normalization | Hundredths; zero → 100 ms; positive floor 20 ms | Fractional numerator/denominator; minimum 1 ms |
| Compositing | Transparent indexes and palette replacement | Source replacement or straight-alpha source-over |
| Disposal | Keep, background/transparent clear, previous | None, transparent background clear, previous |
| Loop count | Validated, not exported | Validated, not exported |
| Original layers | Unavailable | Unavailable |
Which input should you prefer?
Use the original project file when you need supported layer structure. Use a PNG sequence when you have clean full-frame exports and want the simplest, most predictable source. Use GIF or APNG when its embedded timing and compositing are the information you need to retain.
Verification checklist
- Compare frame count and the first and last snapshots.
- Check a frame with transparency and a frame drawn at an offset.
- Check motion immediately after a disposal operation; errors often appear one frame later.
- Compare both a short and long frame delay.
- Expect one generated layer and do not infer missing authoring layers from the rendered pixels.
When the animation is rejected, the file may be valid but outside the documented subset. The troubleshooting guide explains how to distinguish that case from corruption or browser limits.