From Surf Wiki (app.surf) — the open knowledge base
APNG
File format
File format
| Field | Value |
|---|---|
| name | Animated PNG |
| screenshot | file:Animated PNG example bouncing beach ball.png |
| caption | Animated PNG (APNG) of a bouncing beach ball (displays as a static image in some web browsers) |
| extension | , |
| mime | , , |
| owner | Mozilla Foundation (adopted by W3C) |
| genre | animated lossless bitmap image |
| released | |
| extendedfrom | PNG |
| open | yes |
Animated Portable Network Graphics (APNG) is a file format which extends the Portable Network Graphics (PNG) specification to permit animated images that work similarly to animated GIF files, while supporting images with a higher color depth and full alpha transparency not available for GIFs. It also retains backward compatibility with non-animated PNG files. It was developed by the Mozilla Foundation in 2004.
The first frame of an APNG file is stored as a normal PNG stream, so most standard PNG decoders are able to display the first frame of an APNG file. The frame speed data and all of the subsequent frames are stored in extra chunks (as provided for by the original PNG specification).
APNG competed with Multiple-image Network Graphics (MNG), a comprehensive format for bitmapped animations which was created in 2001 by the same team as PNG, which is now obsolete. APNG's advantages over MNG are its smaller library size and its compatibility with older PNG implementations.
History and development
The APNG specification was created in 2004 by Stuart Parmenter and Vladimir Vukićević of the Mozilla Corporation to allow for storing the animations needed for interfaces such as throbbers. In May 2003, Mozilla had scrapped support for MNG animations, which provides a superset of APNG functionality, citing concerns about the large file size required for the expansive MNG decoder library (300 KB); the APNG decoder, built on the back of the PNG decoder, was a much smaller component.
Among users and maintainers of the PNG and MNG formats, APNG had a lukewarm reception. In particular, PNG was conceived to be a single-image format. APNG hides the subsequent frames in PNG ancillary chunks in such a way that APNG-unaware applications would ignore them, but there are otherwise no changes to the format to allow software to distinguish between animated and non-animated images. Some of the main concerns arising from this were the inability of applications to negotiate for PNG and APNG, or distinguish between PNG and APNG once received, or for legacy software to even inform users that there are additional frames. Glenn Randers-Pehrson spearheaded efforts to reconcile the PNG purists' position with that of APNG proponents by recommending changes to APNG's format and proposing the use of a unique MIME type (e.g., video/png), but the APNG proponents only added the different MIME type (image/apng) while insisting on the use of the .png extension instead of .apng, leading to the format not being approved by the PNG Development Group.
The PNG Development Group rejected APNG as an official extension on April 20, 2007, and there have been several subsequent proposals for a simple animated graphics format based on PNG using several different approaches. However, since September 14, 2021, the PNG Working Group has been chartered by the World Wide Web Consortium (W3C) to maintain and develop for the PNG specification, and the first public working draft of PNG Specification (Third Edition) was published on October 25, 2022, adding APNG extensions to the core PNG specification. The Candidate Recommendation was published on September 21, 2023.
On June 24, 2025 it was finally elevated to the Recommendation final status by the W3C.
| Advantage | APNG | aNIM | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| (mPNG) | ANG | PNG-in-GIF | RGBA-in-GIF | Ani-PNG | MNG | Fallback | Fallback quality | Browser fallback | Viewer fallback | Editor fallback | Efficiency | Size optimization | Reusable image parts | Streaming | JNG support | Implementation | Decoder implementation | Encoder implementation | Purity | Standard compatibility | Distinction still / animated | File name extension | MIME type | Status | ||
| .png | .apng | .ang | .gif | .gif | .mng | .mng | ||||||||||||||||||||
| video/png, image/png | video/png, image/png | video/ang | image/gif | image/gif | video/mng | video/mng | ||||||||||||||||||||
| vote failed, | ||||||||||||||||||||||||||
| implemented | voting? | proposed | voting? | proposed | approved | approved, | ||||||||||||||||||||
| spotty support |
File format
The APNG specification follows the PNG File format introducing three new ancillary chunks:
- The animation control chunk (acTL) precedes the IDAT(s) of the default image and is a kind of "marker" that this is an animated PNG file. It also contains the number of frames and the number of times to loop the animation (0 meaning infinite).
- The frame control chunk (fcTL) precedes each frame and contains its metadata : dimensions; position (relative to the default image); duration; if once over it is cleared to black, replaced by the previous frame or drawn over by the next frame; and if its transparency applies.
- The frame data chunk (fdAT) storing frame's content. It starts with a sequence number, then has the same structure as the default image's IDAT chunk(s).
Sequence numbers apply to both frame control and frame data chunks, which together follow a common sequence, thus enabling the order and timing of frames to be recovered should an APNG-unaware PNG editor re-order them as allowed by PNG chunk ordering rules.
Frames utilize the same bit depth, color type, compression method, filter method, interlace method, and palette (if any) as the default image.
An application reading a PNG file is meant to ignore any chunks which it does not understand, making APNG backwards compatible. Applications without support for the APNG extension show only the first frame, disregarding the rest of the frames.
Compression and optimization
A number of optimization techniques make APNG files as small as possible: Inter-frame optimization utilizing alpha-blend and alpha dispose operations, smaller than the full-size subframes, dirty transparency, color type and color palette optimizations, and various compression options: zlib, 7-Zip, Zopfli.
Derived formats
Animated stickers for Signal are APNG with some restrictions (the size of the file is limited to 300kb, the length of the animation is limited to 3 seconds and, visibly (this last point is unclear), the resolution must be 512x512px).
Support
Mozilla Firefox added support for APNG in version 3 trunk builds on March 23, 2007. However, because libpng is the PNG Group's reference implementation of the official specification, APNG support was not added prior to version 1.8 of the main libpng distribution since it was unratified by the Group before. Iceweasel 3 supports APNG by using Mozilla's unofficial variant of libpng.
In 2008 WorldDMB adopted APNG as a backward compatible extension to enable animation as part of the MOT SlideShow user application for Digital Radio. "APNG 1.0 Specification - Animated Portable Network Graphics" is included as normative Annex A in the ETSI standard TS 101 499 V2.2.1. In 2016, Apple adopted the APNG format as the preferred format for animated stickers in iOS 10 iMessage apps. On March 15, 2017, APNG support was added to Chromium.
| Field | Software | Supports? | Since | |||
|---|---|---|---|---|---|---|
| Image | ||||||
| processing | APNG Assembler | v. 2.91 | ||||
| cphktool APNG Anime Maker | v. 1 (9 June 2009) | |||||
| APNG Disassembler | v. 1 | |||||
| APNG Optimizer | v. 1.0 (28 March 2011) | |||||
| Chasys Draw IES | v. 5.17.05 | |||||
| Clip Studio Paint | v. 1.6.7 (7 September 2017) | |||||
| FFmpeg | v. 2.7 | |||||
| v. 2.3.13 | ||||||
| Gamani GIF Movie Gear | v. 4.2 (March 2008) | |||||
| GID | v. 11 (December 2023) | |||||
| GIMP | Planned | |||||
| Honeycam | v. 3.48 (29 November 2021) | |||||
| Honeyview | v. 5.10 (17 February 2015) | |||||
| ImageJ | v. 1.41g (3 July 2008) | |||||
| ImageMagick | v. 7.0.10-31 (20 September 2020) | |||||
| Imagine | v. 1.0.2 (4 May 2008) | |||||
| IrfanView | v. 4.40 (31 July 2015) | |||||
| Konvertor | v. 4.02 (May 2010) | |||||
| KSquirrel (later SAIL) | v. 0.7.2 (3 October 2007) | |||||
| Paint.NET | ||||||
| PhotoLine | v19.5 (11 March 2016) | |||||
| RealWorld Paint | v. 2011.1 (December 2011) | |||||
| VirtualDub | ||||||
| XnView | v. 1.97.4 (30 April 2010) | |||||
| Sciter and HTMLayout UI engines | since 2008 | |||||
| Krita | Krita Nightly 5.0.0 pre-alpha (since 22 February 2021) | |||||
| qView | v. 4.0 (31 October 2020) | |||||
| Browser | ||||||
| engines | WebKit | (17 March 2015) | ||||
| Blink | June 2017 | |||||
| Web | ||||||
| browsers | Mozilla Firefox | |||||
| (Gecko layout engine) | v. 3 (17 June 2008) | |||||
| SeaMonkey | ||||||
| (Gecko layout engine) | v. 2 | |||||
| Iceweasel and other Debian rebrandings | ||||||
| (Gecko layout engine) | v. 4.0~b12 | |||||
| Safari | ||||||
| (WebKit layout engine) | title=Animated PNG (APNG) | url=http://caniuse.com/#feat=apng | website=Can I use... Support tables for HTML5, CSS3, etc}} | |||
| Google Chrome and Chromium | ||||||
| (Blink layout engine) | title=7d2b8c45afc9c0230410011293cc2e1dbb8943a7 - chromium/src - Git at Google | url=https://chromium.googlesource.com/chromium/src/+/7d2b8c45afc9c0230410011293cc2e1dbb8943a7 | website=chromium.googlesource.com}} | |||
| Internet Explorer | ||||||
| (Trident layout engine) | ||||||
| Microsoft Edge [Legacy] | ||||||
| (EdgeHTML layout engine) | title=The status of APNG image format in Microsoft Edge | url=https://developer.microsoft.com/en-us/microsoft-edge/platform/status/apngimageformat/ | access-date=2017-07-29 | website=Microsoft Edge Development}} | ||
| Microsoft Edge | ||||||
| (Blink layout engine) | v. 79 | |||||
| Opera v12 and earlier | ||||||
| (Presto layout engine) | v. 9.5 (12 June 2008) | |||||
| Opera 15 and later | ||||||
| (Blink layout engine) | v. 46.0 (22 June 2017) | |||||
| Pale Moon (Goanna layout engine) | v. 27 | |||||
| Mobile | ||||||
| browsers | iOS Safari | v. 8.0 | ||||
| Firefox for Android | ||||||
| Samsung Internet for Android | v. 7.0 | |||||
| Opera Mobile | ||||||
| Productivity | ||||||
| software | LibreOffice | Planned |
A server-side library exists that allows web browsers that support the canvas tag, but do not support APNG, to display APNGs. Examples of such browsers include Microsoft Edge Legacy and Internet Explorer 9.
References
References
- (27 August 2004). "Add APNG support for Mozilla". Mozilla Foundation.
- (2 September 2004). "APNG 0.4 [DRAFT]". Vladimir Vukicevic.
- martin. (1999-11-11). "Bug 18574 - (mng) restore support for MNG animation format and JNG image format". [[Mozilla]].
- "PNG (Portable Network Graphics) Specification, Version 1.1#8.4. Multiple-image extension". [[libpng]].
- "APNG Specification, Version 1.0#MIME type". Mozilla.
- "ImageMagick can't detect animated PNG".
- (2007-04-20). "VOTE FAILED: APNG 20070405a". [[SourceForge]] mailing list.
- "Discussion for a simple "animated" PNG format".
- (2023-05-24). "PNG Third Edition, Explained".
- (2023-09-21). "PNG Specification (Third Edition), APNG: frame-based animation".
- Fallback of GIF encapsulated formats is animated.
- may lose the entire animation
- may lose the animation details, but not the image data
- may lose the high-quality PNG image data
- Frame composition from multiple parts of the image
- not in the current proposal, but could be made possible though only for a single sprite!
- Supports both PNG and JNG simultaneously
- A distinction between still and animated files can be made visible on file-level by using special extension and mime-type, but cannot be enforced.
- A distinction between still and animated files is not visible on file-level, but this is an existing problem for the GIF extension.
- Ani-PNG is a new subset of MNG that does not need formal approval, but it uses new PlAY and ReCO chunks which are not yet officially registered.
- "APNG Specification - MozillaWiki".
- [http://www.libpng.org/pub/png/spec/1.2/PNG-Ordering.html Chunk Ordering Rules] (PNG 1.2 spec)
- "Portable Network Graphics (PNG) Specification (Second Edition)".
- "Inter-frame Optimization in APNG".
- "APNG Assembler".
- "Stickers". Signal.
- (2007-03-23). "Gran Paradiso Alpha 3 release notes". [[Mozilla]].
- (2011-08-26). "Debian Bug #486827 Iceweasel cannot render APNG image". [[Debian]].
- "Digital Audio Broadcasting (DAB); MOT SlideShow; User Application (pdf) Specification". ETSI.
- "Messaging - Extensions - iOS Human Interface Guidelines". Apple, Inc..
- "Anzwix / Chromium / Add support for Animated PNG".
- maxst. (15 November 2017). "APNG Assembler".
- "cphktool APNG Anime Maker". cphktool.
- maxst. "APNG Disassembler".
- maxst. "APNG Optimizer".
- "Online Help for Chasys Draw IES: File Formats - Other Image Files".
- "Online Help for Chasys Draw IES: History".
- "CLIP STUDIO PAINT Version 1.6.7 release notes (9/7/2017)".
- "FFmpeg Formats Documentation".
- "GitHub changelog of FFmpeg".
- "FireAlpaca Update History".
- "Animated PNG: Simple Animation with an Alpha Channel". Gamani.
- "GID (Generic Image Decoder)".
- "Issue #1278: Initial APNG load support".
- "Honeycam - Version history". Bandisoft International Inc..
- "Honeyview - Version history". Bandisoft International Inc..
- "ImageJ News". [[ImageJ]].
- "ImageMagick - Changelog".
- "Imagine - What's new".
- "Konvertor - Solutions for Multimedia Processing".
- (15 October 2021). "KSquirrel Codecs ChangeLog".
- (7 January 2022). "'PNG Animations and Images' FileType Plugin (.PNG, .APNG) [Latest v1.4 2022-01-07]".
- "More about animated PNG - Vlasta's blog".
- "SourceForge.net: VirtualDub APNG Mod".
- While XnView is available for several operating systems, only versions for [[Microsoft Windows. Windows]] have been released since APNG support was added.
- "APNG export support".
- (22 February 2021). "APNG and WEBP animation export (dbe993da) · Commits · Graphics / Krita".
- (Mar 17, 2015). "Animated PNG graphics". [[WebKit]].
- (July 4, 2008). "Animated PNG graphics". [[Mozilla]].
- (October 1, 2008). "Firefox 3 for developers". [[Mozilla]].
- "Animated PNG (APNG)".
- "7d2b8c45afc9c0230410011293cc2e1dbb8943a7 - chromium/src - Git at Google".
- "Stable Channel Update for Desktop". Chrome Releases.
- "The status of APNG image format in Microsoft Edge".
- "Web specifications supported in Opera 9.5". [[Opera Software]].
- (22 June 2017). "Opera 46 goes final, more quality and Opera's first TV ad". [[Opera Software]].
- (29 May 2023). "Projects selected for LibreOffice in the Google Summer of Code 2023: Add APNG import/export support". [[LibreOffice]].
- (11 October 2021). "APNG-canvas Library".
This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.
Ask Mako anything about APNG — get instant answers, deeper analysis, and related topics.
Research with MakoFree with your Surf account
Create a free account to save articles, ask Mako questions, and organize your research.
Sign up freeThis content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.
Report