User Rating 0.0
Total Usage 0 times

Drop your APNG file here or click to browse

Supports .png / .apng up to 50MB

Is this tool helpful?

Your feedback helps us improve.

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.

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

Formulas

The APNG frame delay is encoded as a fraction in the fcTL chunk:

delay = delay_numdelay_den seconds

When delay_den = 0, the specification mandates treating it as 100. The GIF delay field uses centisecond units:

gif_delay = round(delay_num × 100delay_den)

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:

d = (r1 r2)2 + (g1 g2)2 + (b1 b2)2

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

PropertyAPNGGIF
Max Colors16,777,216 (24-bit)256 per frame
Alpha Channel8-bit (smooth)1-bit (on/off)
CompressionDeflate (lossless)LZW
Min Frame Delay0ms (arbitrary fraction)10ms
Loopingnum_plays in acTLNetscape Extension block
Browser SupportChrome, Firefox, Safari, EdgeUniversal
Social Media SupportLimitedUniversal
SpecificationPNG Group Extension (2008)CompuServe GIF89a (1989)
Dispose Operations3 modes (none, background, previous)3 modes (equivalent)
Blend Operations2 modes (source, over)Not applicable
Typical File Size (30 frames)200 - 500KB400 - 1200KB
InterlacingAdam7 supportedRow-based supported
Metadata (Exif/XMP)Via ancillary chunksComment extension only
Max Dimensions231 1 pixels65,535 × 65,535 pixels

Frequently Asked Questions

GIF is limited to 256 colors per frame. APNG supports 16.7 million colors (24-bit). When a frame contains smooth gradients, the median-cut quantization must map thousands of color values into 256 buckets. This produces visible steps between color bands. To minimize banding, use APNG sources with flat colors or limited palettes. Dithering is not applied by default to keep file sizes smaller.
APNG uses Deflate compression (the same as gzip), which is generally more efficient than GIF's LZW compression. Additionally, APNG supports inter-frame delta encoding where only changed pixels are stored. This converter renders each frame fully for maximum compatibility, which increases GIF size. Files with many frames or complex scenes will see the biggest size increase.
GIF supports only binary transparency: a pixel is either fully opaque or fully transparent. Pixels with alpha values above 128 are treated as opaque; those at or below 128 become transparent. This means soft edges, drop shadows, and glass effects will appear jagged. Pre-compositing against a white background is applied for opaque regions to prevent color distortion.
The speed multiplier scales each frame's delay by dividing the original delay by the multiplier value. Since GIF timing resolution is 10ms (centisecond units), the result is rounded to the nearest centisecond. At very high speed multipliers (above 5×), most frames collapse to the minimum 20ms delay, making further speed increases imperceptible. The minimum enforced delay is 20ms because browsers interpret 0ms or 10ms delays inconsistently.
Yes. A static PNG is technically a valid APNG with one frame. The converter will detect the absence of an acTL chunk and treat the entire image as a single frame, producing a static GIF. This works but is inefficient; a dedicated PNG-to-GIF converter would be more appropriate for static images.
The converter processes files up to 50MB in browser memory. Frame count is bounded by available RAM. On a device with 4GB of free memory, approximately 500 frames at 500×500 pixels can be processed. Each frame requires width × height × 4 bytes for RGBA data. For a 1000×1000 frame, that is roughly 4MB per frame, limiting practical count to around 250 frames on modest hardware.