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.
Technical Specifications
.apng.png
Deflate (zlib)
image/apngimage/png
Magic Bytes & HTTP Headers
\x89PNG\r\n\x1a\n
Browser Support Matrix
| Browser | Status | Min Version |
|---|---|---|
|
|
Supported | 59 |
|
|
Supported | 3 |
|
|
Supported | 8 |
|
|
Supported | 79 |
|
|
Not Supported | Legacy |
Advantages & Limitations
- 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
- 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
File Detection Steps
How to programmatically detect a image/vnd.mozilla.apng
file by reading its raw bytes:
- 1 Check the standard PNG magic bytes: 89 50 4E 47 0D 0A 1A 0A.
- 2 Iterate through the PNG chunks reading the 4-byte chunk type headers.
- 3 If you encounter the ASCII string 'acTL' (Animation Control) before encountering an 'IDAT' (Image Data) chunk, the file is an APNG.
Software Support
ImageMagick
Conversion Tools
Share & Embed
[](https://freewebptojpg.com/mime/image/apng)
<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
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.