← All articles 8 min read

How to Convert GIF to APNG: 4 Free Methods (2026)

GIF has been the default animated image format since 1987 — and it shows. The format caps out at 256 colors per frame and only supports binary transparency: a pixel is either fully visible or fully invisible. Try placing an animated GIF over a gradient background and you get jagged, ugly edges where smooth transparency should be.

APNG (Animated PNG) solves both problems. It delivers 24-bit color (16.7 million colors), full 8-bit alpha transparency, and often compresses to smaller file sizes than the equivalent GIF. Every modern browser supports it as of 2024. If you are still shipping GIFs for UI animations, emoji, or stickers, you are leaving quality and performance on the table.

Here is how to convert GIF to APNG using four different methods — pick the one that fits your workflow.


What Is APNG?

APNG extends the PNG format with animation support. Each frame is a full PNG image with the same compression and color depth. The format was created by Mozilla in 2004 and standardized as a PNG extension, which means any application that reads PNG can display at least the first frame of an APNG file — graceful fallback is built into the format.

Key advantages over GIF:

For a deeper look at the GIF format and its constraints, see what is GIF.


GIF vs APNG: Side-by-Side Comparison

Feature GIF APNG
Color depth 256 colors (8-bit) 16.7 million (24-bit)
Transparency 1-bit (on/off) 8-bit alpha channel
Typical file size Baseline 15-30% smaller for photographic content
Browser support Universal All modern browsers (since 2024)
Editor support Universal Growing (most major tools)
Lossy option No No
First frame fallback N/A Displays as static PNG
Max frames No hard limit No hard limit

GIF still wins on one axis: universal editor and platform support. Email clients, Slack, Discord, and older CMS platforms all handle GIF natively. APNG support in these contexts is less consistent. For web publishing, social media stickers, and UI animations, APNG is the better format.


Method 1: Online Converters

The fastest path if you need to convert a few files without installing anything.

EZGIF

EZGIF is a free web-based tool that handles GIF-to-APNG conversion:

  1. Go to ezgif.com/gif-to-apng.
  2. Upload your GIF (max 50 MB).
  3. Click Convert to APNG.
  4. Download the result.

EZGIF also lets you adjust frame delay and optimize the output before downloading. The main drawback: your file is uploaded to their server for processing.

Aconvert

Aconvert offers a similar workflow. Upload, select APNG as the target format, and download. Supports files up to 200 MB but provides fewer optimization controls than EZGIF.

Both tools work for quick one-off conversions. For batch processing or privacy-sensitive files, use a local tool instead.


Method 2: ImageMagick (CLI)

ImageMagick v7.1.1 (Apache 2.0 license) converts GIF to APNG in a single command:

# Install ImageMagick 7.1.1
# macOS
brew install imagemagick

# Ubuntu/Debian
sudo apt install imagemagick=7:7.1.1-*

# Convert GIF to APNG
magick input.gif output.apng

ImageMagick reads every frame of the animated GIF and writes them into an APNG file with default PNG compression. To control compression level:

# Maximum compression (slower, smaller output)
magick input.gif -quality 95 output.apng

# Set a specific loop count (0 = infinite)
magick input.gif -loop 0 output.apng

Batch conversion

# Convert all GIFs in the current directory
for f in *.gif; do magick "$f" "${f%.gif}.apng"; done

ImageMagick is the most versatile option — it handles hundreds of formats and integrates into any build pipeline. If you already have it installed for image compression or format conversion, adding GIF-to-APNG conversion requires zero additional setup.


Method 3: FFmpeg (CLI)

FFmpeg v7.0 (LGPL 2.1+ license) treats APNG as a video codec, which gives you fine-grained control over frame timing and optimization:

# Install FFmpeg 7.0
# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt install ffmpeg=7:7.0-*

# Basic GIF to APNG conversion
ffmpeg -i input.gif -plays 0 output.apng

The -plays 0 flag sets infinite looping (equivalent to GIF's loop behavior). Without it, the animation plays once and stops.

Advanced options

# Control frame rate (useful for smoothing choppy GIFs)
ffmpeg -i input.gif -plays 0 -r 15 output.apng

# Set maximum file size with compression level
ffmpeg -i input.gif -plays 0 -pred mixed -pix_fmt rgba output.apng

Key flags:

Batch conversion

for f in *.gif; do ffmpeg -i "$f" -plays 0 "${f%.gif}.apng"; done

FFmpeg is the right choice when you need to modify frame timing during conversion or integrate APNG output into a media processing pipeline. If you are already using FFmpeg to create GIFs from video, adding an APNG output stage is trivial.


Method 4: XnConvert (GUI)

XnConvert v1.99 is a free (for personal use) multi-platform batch image converter with a graphical interface. It supports Windows, macOS, and Linux.

  1. Download and install XnConvert v1.99 from xnview.com.
  2. Open XnConvert and drag your GIF files into the Input tab.
  3. Go to the Output tab.
  4. Set the format to APNG.
  5. Choose your output folder.
  6. Click Convert.

XnConvert preserves animation and supports batch processing — drop 50 GIFs and convert them all at once. It also includes optional actions (resize, crop, adjust colors) that run before the format conversion, making it useful for preparing images for specific platforms.


Method 5: apngasm (Specialized CLI)

For maximum control over APNG output, apngasm v3.1.10 is a dedicated APNG assembler. It does not convert GIF directly — instead, you extract GIF frames and reassemble them as APNG.

# Step 1: Extract GIF frames with ImageMagick 7.1.1
magick input.gif -coalesce frame_%04d.png

# Step 2: Assemble frames into APNG with apngasm 3.1.10
apngasm output.apng frame_*.png 1 10

The 1 10 arguments set the frame delay to 1/10th of a second (100ms per frame). Adjust to match your GIF's original timing.

This two-step approach gives you the opportunity to edit individual frames, remove duplicates, or adjust timing before assembly. It is overkill for simple conversions but invaluable for frame-level animation control.


Optimization Tips

Converting GIF to APNG is step one. Optimizing the output makes the file smaller and the animation smoother.

Frame delay optimization

Match the output frame delay to the source GIF. GIFs commonly use delays of 20ms (50 fps), 33ms (30 fps), or 100ms (10 fps). Mismatched timing produces jittery playback. FFmpeg and apngasm both let you set explicit frame delays.

Inter-frame optimization

APNG supports inter-frame compression — storing only the pixels that change between frames instead of re-encoding the entire image. ImageMagick and FFmpeg apply this automatically. For manually assembled APNGs using apngasm, enable inter-frame optimization with the -z2 flag:

apngasm output.apng frame_*.png 1 10 -z2

Disposal methods

APNG supports three frame disposal methods: none (keep frame visible), background (clear to background), and previous (restore previous frame). The right disposal method depends on your animation. Full-frame animations work best with none. Overlay animations with partial transparency need background or previous to avoid ghosting artifacts.

Trim unnecessary frames

If your GIF has duplicate frames (common in GIFs exported from video), remove them before conversion. Fewer frames means a smaller file. ImageMagick can detect and remove duplicates:

magick input.gif -layers optimize-transparency output.gif

Then convert the optimized GIF to APNG.


When to Use APNG Over GIF

APNG is the better choice when your animation needs:

If you are working with animated content and also need to adjust animation speed or build animations from still frames, APNG handles both workflows cleanly.

When to Stick with GIF

GIF remains the practical choice for:

If file size is your primary concern and compatibility allows it, converting GIF to WebP offers even larger file size reductions through lossy compression.


Frequently Asked Questions

Does converting GIF to APNG improve image quality?

No — conversion does not add color information that was not in the original GIF. A GIF with 256 colors will still have 256 colors after conversion to APNG. The benefit is that future edits and compositing operations use the full APNG color space, and transparency edges render smoothly on any background.

Do all browsers support APNG?

Yes. Chrome (since v59), Firefox (since v3), Safari (since v8), Edge (since v79), and Opera all support APNG. As of 2026, this covers over 98% of global browser usage. Internet Explorer is the only notable exception, and Microsoft discontinued it in 2022.

Can I convert APNG back to GIF?

Yes, but you lose quality. The conversion maps APNG's 16.7 million colors down to GIF's 256, and smooth alpha transparency is reduced to binary on/off. Use ImageMagick v7.1.1:

magick input.apng output.gif

Is APNG the same as animated WebP?

No. Both support animation with full color and alpha transparency, but they use different compression algorithms. WebP offers lossy compression (APNG does not), which means WebP files can be significantly smaller when some quality loss is acceptable. APNG uses lossless PNG compression only. Choose APNG when you need lossless quality; choose WebP when file size matters most.

What is the maximum file size for APNG?

There is no format-level file size limit. APNG follows the PNG specification, which supports images up to 2,147,483,647 x 2,147,483,647 pixels. Practical limits come from available memory during encoding and decoding. For web use, keep APNG files under 5 MB — browsers handle them fine, but larger files delay page rendering.


Start Converting

Pick the method that matches your workflow: online tools for quick one-offs, ImageMagick or FFmpeg for CLI pipelines, XnConvert for batch GUI work, or apngasm for frame-level control. The conversion itself is fast — most GIFs convert in under a second.

For other format conversions, Pixotter's convert tool handles dozens of image formats directly in your browser with no upload required.

Also try: Compress Images