Animated PNG to GIF Converter
Convert APNG (Animated PNG) files to GIF format online. Adjust speed, quality, and loop settings. Free browser-based converter with real LZW encoding.
Drop your APNG file here or click to browse
Supports .png / .apng up to 50MB
About
APNG (Animated Portable Network Graphics) supports 24-bit color with 8-bit alpha transparency, but browser and platform support remains inconsistent. Social media platforms, messaging apps, and legacy systems often reject APNG files while universally accepting GIF. This converter parses the APNG binary structure - extracting acTL, fcTL, and fdAT chunks per the PNG extension specification - then reconstructs each frame, applies median-cut color quantization to 256 colors, and encodes the result using LZW compression into a valid GIF89a binary. All processing runs locally in your browser. No data leaves your machine.
Limitations: GIF is restricted to 256 colors per frame and binary transparency (no partial alpha). Gradients and semi-transparent regions will exhibit banding or hard edges. Frame timing resolution in GIF is 10ms increments, so sub-10ms APNG delays get rounded. For photographic animations exceeding 50 frames, expect output files larger than the source due to GIF's inferior compression ratio compared to APNG deflate.
Formulas
The APNG frame delay is encoded as a fraction in the fcTL chunk:
When delay_den = 0, the specification mandates treating it as 100. The GIF delay field uses centisecond units:
Where gif_delay is clamped to a minimum of 2 (i.e., 20ms) because many renderers interpret 0 or 1 as 100ms.
Color quantization uses the median-cut algorithm. Given N unique colors in a frame, the color space is recursively bisected along the axis of greatest range until 256 buckets remain. Each pixel is then mapped to the nearest palette entry using Euclidean distance in RGB space:
LZW compression starts with a code size of minCodeSize + 1 bits, where minCodeSize = max(2, ceil(log2(paletteSize))). The dictionary grows until code size reaches 12 bits (4096 entries), at which point a clear code resets it.
Reference Data
| Property | APNG | GIF |
|---|---|---|
| Max Colors | 16,777,216 (24-bit) | 256 per frame |
| Alpha Channel | 8-bit (smooth) | 1-bit (on/off) |
| Compression | Deflate (lossless) | LZW |
| Min Frame Delay | 0ms (arbitrary fraction) | 10ms |
| Looping | num_plays in acTL | Netscape Extension block |
| Browser Support | Chrome, Firefox, Safari, Edge | Universal |
| Social Media Support | Limited | Universal |
| Specification | PNG Group Extension (2008) | CompuServe GIF89a (1989) |
| Dispose Operations | 3 modes (none, background, previous) | 3 modes (equivalent) |
| Blend Operations | 2 modes (source, over) | Not applicable |
| Typical File Size (30 frames) | 200 - 500KB | 400 - 1200KB |
| Interlacing | Adam7 supported | Row-based supported |
| Metadata (Exif/XMP) | Via ancillary chunks | Comment extension only |
| Max Dimensions | 231 − 1 pixels | 65,535 × 65,535 pixels |