GIF to APNG

Published Updated

Choose a dimension scale, then convert your GIF into a crisp, full-color APNG and download the result — free, private, and processed entirely in your browser.

Every frame, every delay, no quality loss

This converter reads all the frames of your GIF, with their delays and loop count, and writes them as a lossless animated PNG. Nothing is re-compressed with loss, so the animation looks the same as the GIF at 100%. The download ends in .png, since an APNG is a PNG file that carries extra animation chunks.

A one-frame GIF becomes an ordinary still PNG, and transparency is kept.

GIF and APNG side by side

FeatureGIFAPNG
Colors per frameUp to 256Truecolor, millions
TransparencyOne bit: on or offFull 8-bit alpha
Frame delayWhole hundredths of a secondA fraction, so exact timing is possible
Where it is definedGIF89aSection 4.9 of the PNG specification

What converting a GIF can and cannot add

APNG was designed as a successor to simple animated GIFs, with 24-bit color and 8-bit transparency (PNG specification, section 4.9). A viewer that does not understand the animation chunks shows the static image instead. Chrome, Edge, Firefox, Opera and Safari all play APNG (MDN image format guide).

Those gains only show up when the source has them. A GIF already went through a 256-color palette, so an APNG made from it keeps that look and the same hard transparency edges. What you gain is a lossless truecolor container and, for flat animations, a file that is often smaller.

Using the converter

  1. Step 1

    Add a GIF

    Choose one .gif file. The preview animates it, and the conversion reads every frame, not just the one on screen.

  2. Step 2

    Choose 100%, 75% or 50%

    The output size is the original width and height times the percentage, rounded to whole pixels. Every frame is resized the same way.

  3. Step 3

    Convert and download

    The result line shows pixel size and frame count. The file is saved with a .png extension, because an APNG is a PNG file.

Limits, and how loops are mapped

Large animations are stopped early with a message that names the limit.

  • File and frames: 31.46 MB, 500 frames, 10,000 pixels per side.
  • Total work: 40 million pixels, counted as frames times width times height. Pick 75% or 50% if you are over.
  • Loops: forever stays forever, no loop setting plays once, and a GIF count of N gives N+1 plays.
  • Delays: 10 ms or less becomes 100 ms. Longer delays are kept, up to 65.5 seconds.

If an app shows a still image

Some editors and messengers accept .png but ignore APNG animation. If yours does, keep the GIF, or use GIF to WebP or GIF to MP4.

What happens to a GIF, step by step

The file is scanned first for size, frame count and loop setting, and refused if it breaks a limit. Then every frame is decoded and composited onto the full canvas, so partial-frame tricks inside the GIF are resolved, and the frames are resized if you chose 75 or 50 percent. A PNG encoder then writes them as an APNG: it stores only the rectangle that changes between frames, picks the dispose and blend settings, and uses a palette when 256 colors or fewer are present.

The APNG format puts the play count in an animation-control chunk, where 0 means play indefinitely, and gives each frame a delay as a fraction of a second (PNG Third Edition). That is why a GIF's repeat count has to be translated: a GIF set to repeat N times becomes N+1 plays. Browser support for APNG is described by MDN's image types guide.

Worked example: four generated animations through the tool's code

The test GIFs are synthetic and were written with Pillow 11.3.0: a flat-color clip (a moving disc on a plain background), a gradient clip with grain, one with mixed delays, and one with a single repeat. All are 240 x 180. The site's own conversion function (lib/apngConvert.ts) ran in Node 22, and Pillow read each result back. The frame data and delays come from the tool's return value; the play counts were confirmed with Pillow.

Input GIFGIF sizeAPNG sizeWhat the output kept
Flat clip, 30 frames at 40 ms, repeats 2 times7,761 B5,761 B (7,166 B at 50%)30 frames, 1,200 ms, 3 plays
Gradient with grain, 30 frames, loops forever983,354 B1,141,809 B (534,718 B at 50%)30 frames, loops forever
8 frames, delays 10, 20, 30, 50, 100, 10, 20, 500 ms2,345 B1,619 BDelays 100, 20, 30, 50, 100, 100, 20, 500 ms
6 frames at 100 ms, repeats once1,853 B1,243 B6 frames, 2 plays

Three results are worth reading twice. The APNG was 26 percent smaller for the flat clip and 16 percent larger for the grainy one, so the saving depends on the picture. Halving the size of the flat clip made its APNG larger (7,166 B instead of 5,761 B), most likely because resizing blends the edges and adds colors that the 100 percent version did not have. And the two 10 ms frames came out as 100 ms: the tool treats delays of 10 ms or below as 100 ms, which its own code notes say matches what browsers display.

Edge cases

  • A GIF with no loop extension plays once, and the APNG says 1 play. A GIF with loop count N gets N+1 plays.
  • A one-frame GIF becomes a plain PNG with no animation chunks.
  • The checks are made before decoding: 31.46 MB, 500 frames, and 300 MB (300 x 1,048,576 bytes) for the decoded frames (frames x width x height x 4 bytes). A 240 x 180 clip uses 172,800 bytes per frame, so it is nowhere near that.
  • An app that does not understand APNG should show only the first frame, because the file is a valid PNG.

Converted in three browsers: identical files, identical frames

We ran the converter itself, the same component this page loads, in Google Chrome 157, Firefox 155 and Playwright's WebKit build (not the Safari app), on seven GIFs generated by a script: a disposal test with partial frames and transparent pixels, a disc moving over a transparent background, an eight-frame delay test with and without a loop block, a single frame, and two 320 x 240 clips of 60 frames, one flat with 4 colours and one with 256 colours and per-pixel noise. Pillow 11.3.0 read every result back.

Test GIFGIF sizeAPNG sizeWhat the APNG holds
Disposal test, 80 x 60, 5 frames338 B479 B4-bit palette with transparency, 5 frames, loops forever
Disc on transparency, 120 x 120, 8 frames2,270 B1,505 B (60 x 60 at 50%: 1,758 B)1-bit palette with transparency, 8 frames of 80 ms
Delay test, 64 x 48, 8 frames, no loop block1,652 B682 B1 play; delays 100, 100, 20, 50, 70, 100, 500 and 1,000 ms
The same frames, GIF loop count 31,671 B682 B4 plays
Single frame, 64 x 64278 B191 BA plain PNG with no animation chunks
Flat clip, 4 colours, 320 x 240, 60 frames62,526 B5,080 B (6,264 B at 75%, 5,642 B at 50%)4-bit palette; frames 2 to 60 store only the rectangle that changes
Noise clip, 256 colours, 320 x 240, 60 frames2,369,689 B3,072,718 B (4,289,882 B at 75%, 1,733,686 B at 50%)8-bit RGBA, no palette; every frame stored at full size

All 12 files were byte-for-byte identical in the three engines. The conversion runs as plain JavaScript, a GIF decoder followed by the UPNG encoder, and never draws on a canvas, so the browser has nothing to add. The size follows the picture: the flat clip shrank to 8 percent of its GIF, while the noise clip, written as 8-bit RGBA instead of a palette, grew by 30 percent.

How long it takes, and how each browser plays the APNG

Test GIF at 100%Chrome 157Firefox 155The WebKit build
Flat clip, 62,526 B69 ms113 ms66 ms
Noise clip, 2,369,689 B9,614 ms14,119 ms6,451 ms

Median of 5 runs, from pressing Convert to APNG to the download link, on the two generated 320 x 240, 60-frame clips. The noise clip keeps the button on Converting... for several seconds in every engine.

Each engine's own decoder (WebCodecs ImageDecoder, present in all three) then played the GIF and its APNG frame by frame. Frame counts matched everywhere, and for every animated file each engine reported the same loop setting for the APNG as for its GIF. In Chrome 157 and Firefox 155 every frame of every 100% conversion was pixel-identical to the same frame of the GIF, including the disposal test (5 of 5) and the disc on transparency (8 of 8). The WebKit build matched on every file except the disc: its ImageDecoder returned that GIF and that APNG with no transparent pixels at all and filled the empty area differently, so the pair could not be compared there. Pillow, composing the frames itself, also found every 100% APNG equal to its GIF frame by frame.

GIF to APNG questions

Is the result a real animated PNG?

Yes. Every frame of the GIF is written, with its original delay and the loop count, in a lossless APNG. The file name ends in .png. Open it in a browser tab to watch it play. An app that does not support APNG shows only the first frame.

Are the timing and the looping kept?

Yes. Frame delays are copied. GIF delays of 10 ms or less become 100 ms, which is what browsers display for them anyway. A GIF that loops forever stays that way, one with no loop setting plays once, and a GIF set to repeat N times plays N+1 times, as browsers do.

Does PNG remove the 256-color limit or the hard transparency edges?

No. The container can hold millions of colors and 8-bit transparency, but the pixels come from the GIF, so the picture still has at most 256 colors and on-or-off transparency. Scaled copies can gain a few blended shades along edges.

What do 75% and 50% do?

They resize every frame before the APNG is written. A 400 × 300 GIF becomes 300 × 225 at 75% and 200 × 150 at 50%.

Why was my GIF rejected?

The limits are a 31.46 MB file (30 × 1,048,576 bytes), 500 frames, 10,000 pixels on either side, and 40 million pixels in total (frames times width times height). A 400 × 300 GIF therefore tops out at 333 frames at 100%, and choosing 50% brings the full 500 within reach.

Will the APNG be smaller than the GIF?

It depends on the content. The encoder stores only the part of each frame that changes and uses a palette when there are 256 colors or fewer. In our test, a 60-frame 240 × 180 animation went from 111 KB as a GIF to 12 KB as an APNG, but footage with noise can come out larger.

Why is my APNG bigger than the GIF?

Grain and gradients leave nothing to skip between frames. A gradient clip with grain went from 983,354 B as a GIF to 1,141,809 B as an APNG, while a flat-color clip went from 7,761 B to 5,761 B.

Why did choosing 50% make my APNG larger?

Resizing blends pixels at the edges, which most likely adds colors the original did not have. A flat clip was 5,761 B at 100% and 7,166 B at 50%, although it had a quarter of the pixels.

What does a GIF with a 10 ms delay do?

It is written with 100 ms: a GIF with delays of 10, 20, 30, 50, 100, 10, 20 and 500 ms came out as 100, 20, 30, 50, 100, 100, 20 and 500 ms.

Does the browser I convert in change the APNG?

No. Chrome 157, Firefox 155 and the WebKit build produced byte-identical APNGs for all 12 test conversions at 100%, 75% and 50%. The converter is plain JavaScript and never draws on a canvas, so the result depends only on the GIF and the scale you pick.

Why does a big GIF take several seconds to convert?

Every frame is decoded and written again losslessly on your device, and noisy footage is slow to compress. A 2.3 MB, 60-frame 320 x 240 clip with per-pixel noise took a median 9.6 s in Chrome 157, 14.1 s in Firefox 155 and 6.5 s in the WebKit build; a flat 60-frame clip of the same pixel size took 66 to 113 ms. The button reads Converting... until the file is ready.

Will the APNG play exactly like the GIF?

Frame for frame, yes, at 100%. In Chrome 157 and Firefox 155 each APNG frame matched the GIF's frame pixel for pixel in all seven tests, with the same frame count and loop setting. Only delays of 10 ms or less change: they become 100 ms, which is how browsers show them anyway.

Does the APNG keep a palette like the GIF?

When the animation fits in one. The disposal test and the flat clip came out as 4-bit palette PNGs with 5 entries, while the 256-colour noise clip came out as 8-bit RGBA without a palette and was 30 percent larger than its GIF.

Related Tools