Free webp to jpg
APNG

Animated Portable Network Graphics

image/vnd.mozilla.apng Released 2004 · by Mozilla Corporation (Stuart Parmenter & Vladimir Vukićević)

The image/vnd.mozilla.apng MIME type (now officially standardized by IANA as image/apng) represents the Animated Portable Network Graphics format. Created by Mozilla in 2004, APNG was designed as a modern replacement for the animated GIF. It extends the standard PNG specification to support animation while adding true 8-bit alpha transparency and 24-bit color depth. Crucially, APNG is fully backward compatible; viewers that do not support animation will simply ignore the animation chunks and display the first frame as a standard, high-quality static PNG.

Web & Animation Transparency Animation Progressive Production Ready

Technical Specifications

MIME Type
image/vnd.mozilla.apng
Extensions
.apng.png
Container
PNG Chunk Stream
Compression
Deflate (Lossless)
Algorithms
Deflate (zlib)
Color Depth
8-bit (Indexed), 24-bit (TrueColor), 32-bit (RGBA)
Metadata
EXIF XMP ICC
Capabilities
Transparency
Animation
Progressive Loading
Alpha Channel
HDR Support
Official Specification
Aliases: image/apngimage/png

Magic Bytes & HTTP Headers

File Signature (Magic Bytes)
89 50 4E 47 0D 0A 1A 0A
ASCII: \x89PNG\r\n\x1a\n
HTTP Headers
Content-Type: image/apng
Content-Type: image/vnd.mozilla.apng
HTML Accept Attribute
accept="image/apng, image/vnd.mozilla.apng, .apng"

Browser Support Matrix

Browser Status Min Version
Chrome Chrome
Supported 59
Firefox Firefox
Supported 3
Safari Safari
Supported 8
Edge Edge
Supported 79
Internet Explorer Internet Explorer
Not Supported Legacy

Advantages & Limitations

Advantages
  • Supports 8-bit alpha transparency, completely solving the ugly 'white halo' problem inherent to GIFs
  • Gracefully degrades; viewers that do not support APNG will render a perfectly valid, static PNG of the first frame
  • Provides lossless compression that retains absolute pixel-perfect quality for UI elements and line art
Limitations
  • Because it relies on lossless Deflate compression, file sizes for complex, video-like animations can be massive compared to lossy formats like WebP or AVIF
  • Was initially rejected by the official PNG group, delaying its adoption for nearly a decade
  • Lacks native hardware decoding acceleration, unlike video-based animated formats (like MP4 or WebM)

Developer Code Snippets

import magic
# Libmagic will typically identify APNGs simply as 'image/png' due to the shared header
print(magic.from_file('animation.png', mime=True)) # Outputs 'image/png'
const fs = require('fs');
// Sniffing for the 'acTL' chunk to differentiate APNG from PNG
const buffer = fs.readFileSync('animation.png');
// In a real app, you'd parse lengths, but a quick brute-force indexOf for 'acTL' works for basic detection
const isAPNG = buffer.indexOf(Buffer.from('acTL')) > -1;
console.log('Is APNG:', isAPNG);
import "bytes"
// Go's standard library net/http will return 'image/png'.
// To detect APNG, search the initial bytes for the acTL chunk:
// isAPNG := bytes.Contains(buf[:1024], []byte("acTL"))
$mime = mime_content_type('animation.png');
echo $mime; // Standard setups will resolve this to 'image/png'. Custom binary parsing is needed to detect the acTL chunk.

File Detection Steps

How to programmatically detect a image/vnd.mozilla.apng file by reading its raw bytes:

  1. 1 Check the standard PNG magic bytes: 89 50 4E 47 0D 0A 1A 0A.
  2. 2 Iterate through the PNG chunks reading the 4-byte chunk type headers.
  3. 3 If you encounter the ASCII string 'acTL' (Animation Control) before encountering an 'IDAT' (Image Data) chunk, the file is an APNG.

Software Support

F
FFmpeg
ImageMagick ImageMagick
E
Ezgif
A
Affinity Photo

Conversion Tools

Share & Embed

Markdown Badge
APNG Format Badge
[![APNG Format](https://freewebptojpg.com/mime/image/apng/badge.svg)](https://freewebptojpg.com/mime/image/apng)
Interactive iframe Widget
<iframe src="https://freewebptojpg.com/mime/image/apng/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="APNG Specs"></iframe>

JSON API

All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.

GET https://freewebptojpg.com/mime/image/apng.json Open JSON
Free to use
No auth required
CORS enabled
Use from any domain
Cached 24h
Cache-Control headers set

Frequently Asked Questions

Why should I use APNG instead of an animated GIF?

GIFs are limited to a 256-color palette and 1-bit binary transparency (a pixel is either fully transparent or fully opaque, leading to jagged white halos). APNG supports 24-bit true color and 8-bit alpha transparency, allowing for smooth drop shadows and anti-aliased edges over any background color.

Do APNG files use the .png or .apng file extension?

Most APNG files simply use the standard .png extension to maintain backward compatibility with software that doesn't recognize .apng. Because the underlying file structure is a valid PNG, legacy software will just display the first frame of the animation.

How do I detect if a PNG is actually an animated APNG programmatically?

Because both share the same magic bytes (89 50 4E 47), you cannot just check the file header. You must parse the internal PNG chunks. An APNG is identified by the presence of an 'acTL' (Animation Control) chunk located before the first 'IDAT' (Image Data) chunk.

Related Formats

Share this format