User Rating 0.0
Total Usage 0 times

Drop your .apng file here

or click to browse · Max 50 MB

Is this tool helpful?

Your feedback helps us improve.

About

APNG (Animated Portable Network Graphics) offers superior color depth and alpha transparency over GIF, but remains unsupported in many legacy systems, email clients, and CMS platforms. Converting APNG to GIF without proper frame-timing extraction produces broken animations or static fallback images. This tool parses the APNG binary structure at the chunk level - extracting acTL, fcTL, and fdAT chunks per the PNG specification (ISO/IEC 15948) - then reconstructs each frame on a Canvas. Color depth drops from 32-bit RGBA to an indexed 256-color palette via Median Cut quantization with optional Floyd - Steinberg dithering. Frame delays are preserved by mapping APNG's rational delay (delay_numdelay_den) to GIF's centisecond units. All processing runs locally in your browser. No files leave your device.

apng to gif animated png converter apng converter gif maker image converter apng to gif online

Formulas

Frame delay conversion from APNG rational time to GIF centisecond units:

delaygif = round(delay_num × 100delay_den)

Where delay_num and delay_den are unsigned 16-bit integers from the fcTL chunk. When delay_den = 0, the spec defines it as 100 (i.e., delay in centiseconds directly). Minimum GIF delay is clamped to 2 centiseconds to prevent browser speed-capping behavior.

Median Cut quantization reduces the color space iteratively:

split(bucket) find axis with greatest range in (R, G, B), sort pixels on that axis, bisect at median

Repeated until 256 buckets exist. Each bucket's mean RGB becomes one palette entry. Floyd - Steinberg dithering distributes quantization error e to neighboring pixels with weights 716, 316, 516, 116.

LZW compression for GIF uses variable-width codes starting at minCodeSize + 1 bits (typically 9 bits for an 8-bit palette), growing up to 12 bits, with clear code = 2minCodeSize and EOI code = clear code + 1.

Reference Data

PropertyAPNGGIF (GIF89a)
Max Colors16.7M (24-bit) + alpha256 per frame (indexed)
TransparencyFull 8-bit alpha channelBinary (1-bit on/off)
Color Depth32-bit RGBA8-bit indexed
CompressionDEFLATE (lossless)LZW (lossless, indexed)
Spec / StandardMozilla extension of PNGCompuServe GIF89a (1990)
Browser SupportModern browsers (no IE)Universal
Email Client SupportMinimalUniversal
Looping Controlnum_plays in acTLNetscape App Extension
Frame Delay UnitRational: numden secondsCentiseconds (1/100 s)
Max Frame DelayUnlimited655.35 s
Dispose OperationsNone / Background / PreviousNone / Background / Previous
Blend OperationsSource / OverN/A (replace only)
InterlacingAdam7 supportedRow interlace supported
Typical File SizeSmaller at equal qualityLarger (no alpha, LZW overhead)
Mime Typeimage/apng or image/pngimage/gif
File Signature89 50 4E 47 (PNG)47 49 46 38 39 61
Animation IndicatoracTL chunk presentMultiple image blocks
Dithering NeedNot requiredRecommended for gradients

Frequently Asked Questions

GIF is limited to 256 indexed colors per frame while APNG supports 16.7 million colors with full alpha. Gradients and smooth color transitions inevitably lose fidelity during quantization. Enable the dithering option (Floyd-Steinberg) to distribute quantization error across neighboring pixels, which significantly reduces visible banding at the cost of a slightly larger file and a subtle noise pattern.
GIF only supports binary transparency (a pixel is either fully opaque or fully transparent). During conversion, pixels with alpha below a threshold of 128 are mapped to the designated transparent color index, while pixels above that threshold are treated as fully opaque. Semi-transparent edges will appear jagged. For best results, use APNG files with a solid background color or accept the hard-edge transparency trade-off.
APNG stores delay as a rational number (delay_num / delay_den) in seconds, allowing sub-millisecond precision. GIF uses centisecond integers (1/100 s). The converter rounds to the nearest centisecond and clamps the minimum to 2cs (20ms), because many browsers ignore delays below that threshold and default to 100ms, causing unexpected slowdowns. Frames with a delay_den of 0 are treated as 100 per the PNG specification.
If the file lacks an acTL (Animation Control) chunk, the converter detects it as a non-animated PNG and will notify you. A valid APNG must contain at least one acTL chunk and corresponding fcTL/fdAT chunk pairs. Single-frame APNGs (where num_frames equals 1) are converted to a single-frame GIF.
APNG uses DEFLATE compression on full-color data, which is highly efficient for photographic content. GIF uses LZW on indexed color data. Despite having fewer colors, LZW often produces larger output for complex imagery because each frame stores a full indexed bitmap. Additionally, APNG supports delta-frame encoding more efficiently. Reducing the output dimensions or color count can help shrink the GIF.
Yes. The converter reads each frame's dispose_op (APNG_DISPOSE_OP_NONE, BACKGROUND, or PREVIOUS) and blend_op (APNG_BLEND_OP_SOURCE or OVER) from the fcTL chunk. It composites frames onto a canvas respecting these operations before capturing the final pixel data for GIF encoding. GIF disposal methods (do not dispose, restore to background, restore to previous) are mapped accordingly.