Black Friday40% off all plans

What Is APNG? APNG vs GIF, Browser Support and How to Convert

By Hieu Dinh

What Is APNG? The Short Answer

APNG (Animated Portable Network Graphics) is a PNG file that holds several frames and plays them as an animation, like a GIF. The difference is quality: APNG keeps PNG's full 24-bit colour and smooth 8-bit transparency, where GIF is stuck at 256 colours and hard-edged, on/off transparency. Every current browser plays it.

It isn't automatically smaller than GIF, though, and outside the browser plenty of apps ignore the animation and show only the first frame. Below you'll find what APNG actually is, how it compared to GIF, WebP and MP4 in our own size tests, where it is (and isn't) supported, and tested FFmpeg commands for GIF to APNG, video to APNG, and APNG to GIF.


What Is APNG, Technically?

APNG is an extension of PNG, created at Mozilla in 2004 by Stuart Parmenter and Vladimir Vukićević, and first shipped in Firefox 3 in 2008. For years it was unofficial: the PNG Development Group had backed a separate, more complex format called MNG and declined to adopt APNG. Browsers adopted it anyway, and in June 2025 the W3C published the PNG Specification (Third Edition) as a Recommendation, which formally adds animated PNG (along with HDR support) to the PNG standard and registers the image/apng media type.

The clever part is backwards compatibility. An APNG is a normal PNG with three extra chunk types:

ChunkWhat it does
acTL (animation control)Says "this PNG is animated", gives the number of frames and how many times to loop. Must come before the image data.
fcTL (frame control)One per frame: its size, position, delay, and how to dispose of and blend it with the previous frame.
fdAT (frame data)The compressed pixels for frames after the first.

The first frame is stored as an ordinary PNG IDAT chunk. A decoder that has never heard of APNG skips the chunks it doesn't recognise and shows that first frame as a still image. That's why APNGs usually keep the .png extension, and also why you often can't tell an APNG from a normal PNG until you open it in a browser.

Each frame can also be a smaller rectangle that only covers the part of the image that changed. FFmpeg's APNG encoder does this automatically: in our flat UI test clip, 57 of the 60 frames were stored as rectangles of roughly 100x80 pixels instead of the full 480x270 canvas.


APNG vs GIF: What Actually Differs

GIFAPNG
Colours256 per frame (8-bit palette)Up to 24-bit truecolour (or 48-bit), or a 256-colour palette
Transparency1-bit: each pixel is fully on or off8-bit alpha: soft edges, shadows, glows
CompressionLZW, lossless on the paletteDeflate (same as PNG), lossless
Partial-frame updatesYesYes
Loop controlYesYes (acTL play count)
Browser supportUniversalAll current browsers (~97% of global usage)
Support in apps, chat and social platformsNearly universalPatchy; many show only the first frame
Standard1987/1989Mozilla 2004; W3C PNG 3rd Edition 2025

Where APNG wins:

  • Colour. Gradients, photos and anti-aliased artwork don't need to be squeezed into a 256-colour palette, so there is no dithering noise or banding.
  • Transparency. This is the big one. A GIF on a coloured background gets a jagged or haloed edge, because each pixel is either fully transparent or fully opaque. APNG's alpha channel handles soft shadows and smooth edges properly, which is why sticker platforms chose it.
  • Size on simple graphics. With a palette and Deflate compression, an APNG of a flat UI animation or icon can be noticeably smaller than the same GIF. Our test below shows this.

Where APNG loses:

  • Size on busy or full-colour content. Lossless full-colour frames are big. For anything resembling video, APNG can be several times larger than a GIF, and both are many times larger than MP4 or WebP.
  • Tooling. Photoshop, most screen recorders and most online "GIF makers" don't export APNG. You'll use FFmpeg, APNG Assembler, or a web tool.
  • Platform support. Browsers are fine. Uploading to social networks, chat apps and CMSs is hit-and-miss: many re-encode the image as a still PNG or show only the first frame.

Our Size Test: GIF vs APNG vs WebP vs MP4

We made three 4-second, 15 fps test clips on a Mac with FFmpeg and encoded each one every way. These are our own synthetic clips, so treat the numbers as a direction, not a universal rule; your results will move with the content.

  • Clip A: a busy, colourful moving test pattern (FFmpeg's testsrc2), 480x270. Think "video-like content".
  • Clip B: a flat UI-style animation, a blue box sliding across a white card, 480x270. Think "product demo or loader".
  • Clip C: a transparent sticker, a soft-edged ball bouncing on a transparent 320x320 canvas.
FormatClip A: busyClip B: flat UIClip C: transparent sticker
GIF (palettegen + paletteuse)1,063 KB65.8 KB14.4 KB (hard edges)
APNG, converted from that GIF2,449 KB57.0 KBn/a
APNG, full colour from source2,568 KB51.8 KB209.3 KB (soft alpha)
APNG, 256-colour palette1,060 KB31.9 KB18.3 KB (hard edges)
Animated WebP, lossless777 KB32.0 KB107.5 KB
Animated WebP, lossy q75423 KB19.8 KB126.4 KB
MP4 (H.264, CRF 23)174 KB9.3 KBno alpha
WebM (VP9 with alpha)not testednot tested6.6 KB

What the numbers say:

  1. On flat graphics, APNG beats GIF. The 256-colour APNG of clip B was less than half the size of the GIF at the same visual quality. This is the case people mean when they say APNG is smaller.
  2. On busy content, a straight GIF to APNG conversion made the file bigger. FFmpeg decodes the GIF's dithered pixels to full colour and compresses them losslessly, which Deflate handles badly. Clip A more than doubled.
  3. Soft transparency costs bytes. The full-alpha APNG sticker looks far better than the GIF, but it's 209 KB against 14 KB. A palette APNG with on/off transparency is GIF-sized, and looks GIF-like too. (Dedicated APNG optimisers can quantise colours while keeping partial alpha; we didn't test those.)
  4. For anything video-like, use video. MP4 was 6x smaller than the GIF on clip A and 7x smaller on clip B, and VP9 WebM with alpha beat everything on the transparent sticker. Our guides to converting GIF to MP4 and GIF to WebP cover those routes, and AVIF vs WebP covers the newest option.

APNG Support: Browsers, Discord, LINE, Telegram and Apple

Browsers

caniuse lists APNG support in Firefox 3+, Safari 8+ (macOS and iOS), Chrome 59+, Edge 79+, Opera and Samsung Internet 7.2+, about 97% of global usage. Old browsers fall back to the first frame. On the web you can use an APNG in a plain <img src="animation.png"> tag, no special markup needed.

Apps and platforms

PlatformAPNG status
DiscordAnimated custom server stickers use APNG: 320x320 px, max 512 KB, per Discord's sticker guide. Upload through Server Settings > Stickers. APNGs posted as regular image attachments are widely reported to display as a still frame. Animated emoji use GIF.
LINEAnimated stickers are APNG files with the .png extension. LINE's creator guidelines set the image size (up to 320x270), a transparent background and a maximum playback time of 4 seconds, and point to APNG Assembler as a tool.
TelegramNot APNG. A common claim, but Telegram's own docs define animated stickers as TGS (Lottie-based vector animation) and video stickers as WebM with VP9.
Apple iMessage stickersApple's sticker pack format accepts APNG and GIF for animated stickers, with a 500 KB file limit per Apple's guidelines.
Social networks, email, CMSsInconsistent. Many strip the animation or convert the upload to a still image. Test before relying on it, or use GIF/MP4.

If Discord is your target, see our guide to compressing a GIF for Discord under 256 KB for emoji, which still need GIF.


How to Convert GIF to APNG

All commands below were tested with FFmpeg on macOS. Install FFmpeg with brew install ffmpeg if you don't have it.

Basic GIF to APNG

ffmpeg -i input.gif -plays 0 -f apng output.png

Don't skip -plays 0. FFmpeg's APNG muxer defaults to playing once, so without it your converted GIF stops after the first loop. (We checked the acTL chunk: the default writes plays=1, the flag writes plays=0, which means loop forever.) -f apng is needed because the .png extension would otherwise make FFmpeg write a single still PNG and stop with an error; if you name the file output.apng FFmpeg picks the format itself.

Remember the caveat from the test: the APNG can't recover colours the GIF already threw away, and on busy, dithered GIFs it can come out larger. It pays off on flat graphics.

GIF to a smaller palette APNG

ffmpeg -i input.gif -vf "split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -plays 0 -f apng output.png

This keeps the output in a 256-colour palette (PNG colour type 3, the same as an indexed PNG), which is usually where the size win over GIF comes from. If you still have the original video, run the same filter on the video rather than the GIF.


How to Convert Video to APNG

Full colour

ffmpeg -i input.mp4 -vf "fps=12,scale=320:-1:flags=lanczos" -plays 0 -f apng output.png

Lower the frame rate and dimensions first; they matter more than anything else. Full-colour APNG is lossless, so a few seconds of real footage can easily run to megabytes.

256 colours (much smaller for UI and screen recordings)

ffmpeg -i input.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -plays 0 -f apng output.png

This is the same palette trick used for high-quality GIFs, explained in our video to GIF converter guide and the MOV to GIF guide for screen recordings.

With transparency

If your source has an alpha channel (a ProRes 4444 or PNG-codec MOV exported from Motion, After Effects or a 3D app), FFmpeg keeps it:

ffmpeg -i input.mov -pix_fmt rgba -plays 0 -f apng output.png

The -pix_fmt rgba matters for ProRes: without it FFmpeg wrote a 16-bit-per-channel APNG from our ProRes 4444 test file, which was more than four times the size of the 8-bit version.

A Discord sticker (320x320, transparent padding)

ffmpeg -i input.mp4 -t 3 -vf "fps=15,format=rgba,scale=320:320:force_original_aspect_ratio=decrease,pad=320:320:-1:-1:color=0x00000000,split[s0][s1];[s0]palettegen=reserve_transparent=1[p];[s1][p]paletteuse" -plays 0 -f apng sticker.png

It fits the clip inside 320x320, pads the rest with transparent pixels and uses a palette to stay small. Our 3-second UI test clip came out at 21 KB, well under the 512 KB limit. Check the file size with ls -l before uploading and lower fps or -t if needed.

APNG makers without the Terminal

If you'd rather not use FFmpeg: APNG Assembler (apngasm), which LINE recommends, builds an APNG from a folder of PNG frames and can optimise it; ezgif.com has APNG maker and optimiser pages in the browser. We didn't test these for this guide, so compare output sizes yourself.


How to Convert APNG to GIF

When a platform won't animate your APNG, convert it to GIF:

ffmpeg -i input.png -vf "split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif

FFmpeg detects the APNG automatically from its contents. For a transparent APNG:

ffmpeg -i input.png -vf "split[s0][s1];[s0]palettegen=reserve_transparent=1[p];[s1][p]paletteuse=alpha_threshold=128" -loop 0 output.gif

alpha_threshold=128 decides which semi-transparent pixels become fully transparent. Soft edges will turn hard; that's GIF's limitation, not FFmpeg's. If the GIF comes out too big, our GIF optimizer guide and how to compress a GIF file cover the next steps.

Often the better move is APNG to MP4 for anything without transparency:

ffmpeg -i input.png -c:v libx264 -pix_fmt yuv420p -crf 23 -movflags +faststart output.mp4

If the width or height is an odd number, add -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2", because H.264 with yuv420p needs even dimensions.


How to Tell if a PNG Is Animated

Finder, Get Info, and the file command all report an APNG as a plain PNG. To check properly:

ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of csv=p=0 file.png

It prints apng for an animated PNG and png for a still one. To count the frames:

ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of csv=p=0 file.png

Without FFmpeg, look for the acTL chunk, which only animated PNGs have:

LC_ALL=C grep -q -a acTL file.png && echo animated || echo static

This is a quick check, not a parser, so trust ffprobe if the two disagree. The easiest visual check is to drag the file into a Safari or Chrome window.


When Should You Use APNG?

Use caseBest choice
Animated stickers for Discord servers, LINE or iMessageAPNG (it's what those platforms ask for)
Small UI animations, icons or loaders with transparency on a websiteAPNG or animated WebP; consider SVG or CSS for vector shapes (SVG vs PNG)
Anything video-like, screen recordings, product demosMP4 or WebM in a <video autoplay muted loop playsinline> tag
Must work everywhere: email, old apps, every chat clientGIF
Website animation where size matters mostAnimated WebP or AVIF, or video; see the best way to reduce GIF size for websites

For still PNGs, the usual size tricks apply: our PNG optimizer guide and how to compress PNG explain palette quantisation and lossless recompression. Note that most still-PNG optimisers will discard the APNG frames, so don't run an animated file through them unless they explicitly support APNG.


Where Compresto Fits

Compresto is a native Mac app for compressing videos, images, GIFs and PDFs locally, in batches. To be clear about the limits: it doesn't preserve APNG animation and doesn't output APNG. If you drop an animated PNG into it, treat the result as a still image. For GIF to APNG, video to APNG and APNG to GIF, use the FFmpeg commands above.

Where it does help is the formats you'll usually reach for instead. Compresto converts video to GIF and compresses existing GIFs, and it converts video to MP4 (H.264 or HEVC, hardware accelerated) or WebM (VP9), which, as our test showed, are far smaller for web animation than either GIF or APNG. It can also trim clips, drop the frame rate, downscale, and target a specific file size, which is often what an upload limit actually requires.


Frequently Asked Questions

What is an APNG file?

An animated PNG: a PNG with extra chunks that store multiple frames and loop settings. Mozilla created it in 2004, and the W3C's PNG Third Edition made it part of the PNG standard in June 2025. Apps that don't support it show the first frame.

Is APNG better than GIF?

In quality, yes: 24-bit colour and 8-bit alpha against GIF's 256 colours and on/off transparency. In size, it depends. Our 256-colour APNG of a flat UI animation was half the size of the GIF, but a full-colour APNG of busy content was more than twice as big.

How do I convert a GIF to APNG?

Run ffmpeg -i input.gif -plays 0 -f apng output.png. Without -plays 0, FFmpeg writes an APNG that plays once and stops.

Do browsers support APNG?

Yes. Firefox, Safari, Chrome, Edge and Opera all play it, about 97% of global usage according to caniuse. Unsupported browsers show the first frame.

Does Discord support APNG?

For animated server stickers, yes: APNG, 320x320 px, under 512 KB. APNGs posted as normal attachments are widely reported to show as still images, so use GIF, MP4 or WebP there.

How can I tell if a PNG is animated?

Run ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of csv=p=0 file.png. It prints apng for animated files. Animated PNGs also contain an acTL chunk, which you can find with grep.


The Short Version

APNG is an animated PNG: GIF-style animation with full colour and real transparency, standardised by the W3C in 2025 and supported by every current browser. Use it where it's expected (Discord server stickers, LINE and iMessage stickers) and for small transparent UI animations. For video-like content, MP4, WebM or animated WebP are much smaller, and GIF remains the safe choice when you need it to play everywhere. When converting, always add -plays 0, and use a palette for the smallest files.

Download Compresto for Mac →

Ready to compress your files? Join thousands of creators using Compresto ⚡