World Library  
Flag as Inappropriate
Email this Article


Article Id: WHEBN0000946476
Reproduction Date:

Title: Apng  
Author: World Heritage Encyclopedia
Language: English
Subject: Portable Network Graphics, Multiple-image Network Graphics, WebP, ANIM, Free Lossless Image Format
Collection: 2004 Introductions, Graphics File Formats, Mozilla
Publisher: World Heritage Encyclopedia


Animated Portable Network Graphics
An animated PNG (displays as static image in some web browsers)
Filename extension .png .apng
Initial release August 4, 2008 (2008-08-04)
Type of format animated raster image format
Extended from PNG
Open format? yes

The Animated Portable Network Graphics (APNG) file format is an extension to the Portable Network Graphics (PNG) specification. It allows for animated PNG files that work similarly to animated GIF files, while supporting 24-bit images and 8-bit transparency not available for GIFs. It also retains backward compatibility with non-animated PNG files.

The first film 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 extra animation frames are stored in extra chunks (as provided for by the original PNG specification).

APNG competes with Multiple-image Network Graphics (MNG), a comprehensive format for bitmapped animations created by the same team as PNG. APNG's advantage is the smaller library size and compatibility with older PNG implementations.


  • History 1
  • Support 2
  • Technical details 3
  • Alternatives 4
    • Raster formats 4.1
    • Vector formats 4.2
    • Scripting and other methods 4.3
  • References 5
  • External links 6


An APNG of an MRI scan of a brain

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);[1] 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.[2] 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 Mozilla rejected these proposals in favor of full backward compatibility.

The PNG group officially rejected APNG as an official extension on April 20, 2007.[3] There have been several subsequent proposals for a simple animated graphics format based on PNG using several different approaches.[4]

Mozilla Firefox added support for APNG in version 3 trunk builds on March 23, 2007.[5] However, because libpng is the PNG Group's reference implementation of the official specification, APNG support can never be supported in the main libpng distribution so long as it remains unratified by the Group. Iceweasel 3 supports APNG by using Mozilla's unofficial variant of libpng.[6]

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.[7] In 2010 Commercial Radio Broadcasters in Sydney began to include APNG animations in DAB+ digital radio broadcasts. These APNG animations are carried by the "MOT slideshow" application which accompanies the audio services. It is expected that other cities in Australia will follow in early 2011.

Mozilla's role in extending the PNG format to APNG echoes Netscape's much earlier role in popularizing animated GIFs.


List of computer programs and their support of APNG, along with their version numbers and release date
Field Software Supports? Since
cphktool APNG Anime Maker Yes v. 1 (June 9, 2009)[8]
Gamani GIF Movie Gear Yes v. 4.2 (March 2008)[9]
GIMP With the APNG Plug-in[10] N/A
ImageJ Yes v. 1.41g (July 3, 2008)[11]
Imagine Yes v. 1.0.4 (November 14, 2008)[12]
IrfanView Read-only v. 4.40 (July 31, 2015)
Konvertor Yes v. 4.02 (May 2010)[13]
KSquirrel Yes v. 0.7.2 (October 3, 2007)[14]
Paint.NET With the animation plugin[15] N/A
RealWorld Paint Yes v. 2011.1 (December 2011)[16]
VirtualDub With VirtualDub APNG Mod[17][1] N/A
XnView Read-only v. 1.97.4 (April 30, 2010)[18]
Sciter and HTMLayout UI engines Read-only Since 2008
Yes (Mar 17, 2015)[19]
Mozilla Firefox
(Gecko layout engine)
Yes v. 3 (June 17, 2008)[20][21]
(Gecko layout engine)
Yes v. 2
Iceweasel and other Debian rebrandings
(Gecko layout engine)
Yes v. 4.0~b12[6]
(WebKit layout engine)
Yes v. 8.0[22]
Google Chrome and Chromium
(Blink layout engine)
With APNG addon[23][24] or Unofficial build N/A
Internet Explorer
(Trident layout engine)
No[25] N/A
Opera v12 and earlier
(Presto layout engine)
Yes v. 9.5 (June 12, 2008)[26]
Opera 15 and later
(Blink layout engine)
With the APNG Plug-in[27] v. 15.0
iOS Safari Yes[28] v. 8.0
iOS app With 3rd party library[29] v. 8.0[22]
Android app OmniGIF(APNG) Player[30] v. (API-Level >= 9)
Firefox for Android Yes[31] ?
Opera Mobile Dropped ?
  1. ^ After loading a video, an APNG file can be created via the "File|Export|Animated PNG" menu item.

A server-side library exists that allows web browsers that support the canvas tag, but do not support APNG, to display APNGs.[32] Examples of such browsers include Google Chrome and Internet Explorer 9.

For image processing software that doesn't export to APNG, users can use a program called APNG Assembler. It creates highly optimized Animated PNG files from PNG/TGA image sequences.[33]

Technical details

A PNG file consists of the PNG Signature (8 special bytes), followed by a series of chunks. A chunk consists of four parts: Length (4 bytes), Chunk type (4 bytes), Chunk data (length bytes) and CRC (Cyclic Redundancy Code / Checksum, 4 bytes).

Structure of a single PNG chunk
(4 bytes)
Chunk type
(4 bytes)
Chunk data
(length bytes)
(4 bytes)

There are about 20 different chunk types, but for a minimal PNG, only 3 are required: The IHDR (image header) chunk, one or more IDAT (image data) chunks and the IEND (image end) chunk.

Structure of a very simple PNG file
89 50 4E 47 0D 0A 1A 0A
PNG signature
Image header
Image data
Image end

The next graphic shows the contents of such a minimal PNG file, representing just one red pixel. The PNG signature bytes and the individual chunks are marked with colors. On the left side, the byte values are shown in hex format, on the right side as their equivalent characters from ISO-8859-1 with unrecognized and control characters replaced with periods. This dual display is common for hex editors. Note that the chunks are easy to identify because of their human readable 4-byte type names (in this example IHDR, IDAT & IEND).

Hex As Characters

89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52
00 00 00 01 00 00 00 01 08 02 00 00 00 90 77 53
DE 00 00 00 0E 49 44 41 54 78 DA 62 F8 CF C0 00
10 60 00 03 01 01 00 66 FD 9F 24 00 00 00 00 49
45 4E 44 AE 42 60 82


The APNG specification introduces three new chunks: The animation control chunk (acTL), the frame control chunk (fcTL) and the frame data chunk (fdAT). The animation control chunk is a kind of "marker" chunk, telling the parser that this is an animated png. It contains information about how many frames the animation consists of and how many times the animation should play before coming to rest. The frame control chunk contains several bits of information, the most important of which is the display time of the following frame. The frame data chunks have the same structure as the IDAT chunks, except preceded by a sequence number. 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[34] should an APNG-unaware PNG editor re-order them as allowed by PNG chunk ordering rules.[35]

A program wanting to assemble several individual PNG files to an animated PNG could proceed as follows:

  1. Take all chunks of the first PNG file as a building basis.
  2. Insert an animation control chunk (acTL) after the image header chunk (IHDR).
  3. If the first PNG is to be part of the animation, insert a frame control chunk (fcTL) before the image data chunk (IDAT).
  4. For each of the remaining frames, add a frame control chunk (fcTL) and a frame data chunk (fdAT). Then add the image end chunk (IEND). The content for the frame data chunks (fdAT) is taken from the image data chunks (IDAT) of their respective source images.

The next diagram illustrates this process.

Diagram illustrating a possible way to assemble an animated png from 3 individual PNG files

The PNG specification was designed with future extensions in mind. An application reading a PNG file is supposed to simply ignore any chunks which it does not understand. This is the reason why APNG is backwards compatible. Existing applications just recognize the first frame and ignore the additional animation chunks.


Raster formats

The MNG file format is a more powerful alternative to APNG, although it's a more complex format and has less web browser support.

The GIF file format has better application and browser support than APNG, but it is limited to 256 colors per frame and supports only index transparency, by mapping one of the palette colors to transparent.

WebM, a video format, has been adopted by some sites such as 4chan as an alternative to other animated formats, including APNG. WebM VP9 supports both lossy and lossless compression.

Vector formats

SVG combined with scripting or SMIL can animate vector graphics and can incorporate raster graphics. (See SVG animation.)

Scripting and other methods

Dynamic graphics created with HTML 5 canvas Object can also be animated. The APNG addon for Google Chrome uses this technique to display APNG images.

CSS Animations is a proposed module for Cascading Style Sheets that allows for the animation of XML elements using CSS.

An alternative method for animations in web pages is to use conventional static images and animate them using JavaScript[36] or plugin based technologies like Adobe Flash, Microsoft Silverlight and Java.


  1. ^ martin (1999-11-11). "Bug 18574 - (mng) restore support for MNG animation format and JNG image format".  
  2. ^ "PNG (Portable Network Graphics) Specification, Version 1.1#8.4. Multiple-image extension".  
  3. ^ "VOTE FAILED: APNG 20070405a".  
  4. ^ "Discussion for a simple "animated" PNG format". Archived from the original on 2009-02-26. Retrieved 2011-07-12. 
  5. ^ "Gran Paradiso Alpha 3 release notes".  
  6. ^ a b "Debian Bug #486827 Iceweasel cannot render APNG image".  
  7. ^ "Digital Audio Broadcasting (DAB); MOT SlideShow; User Application (pdf) Specification" (PDF). ETSI. Retrieved 30 January 2013. 
  8. ^ "cphktool APNG Anime Maker". cphktool. Retrieved 2010-06-28. 
  9. ^ "Animated PNG: Simple Animation with an Alpha Channel". Gamani. Retrieved 2009-08-25. 
  10. ^ APNG Plug-in
  11. ^ "ImageJ News".  
  12. ^ "Imagine - What's new". Retrieved 2009-08-25. 
  13. ^ "Konvertor - Solutions for Multimedia Processing". 
  14. ^ "ksquirrel Changelog Sektion: ksquirrel-0.7.2".  
  15. ^ animation plugin
  16. ^ "APNG support announcement". 
  17. ^ VirtualDub APNG Mod
  18. ^ While XnView is available for several operating systems, only versions for Windows have been released since APNG support was added.
  19. ^ "Animated PNG graphics".  
  20. ^ Parmenter, Stuart; Vladimir Vukicevic; Andrew Smith (July 4, 2008). "Animated PNG graphics". Mozilla Developer Center.  
  21. ^ "Firefox 3 for developers". Mozilla Developer Center.  
  22. ^ a b "Can I use Animated PNG?". Retrieved 2014-05-01. 
  23. ^ "Chrome Web Store - APNG". Retrieved 2013-08-15. 
  24. ^ "Issue 1171 - Request for enhancement: APNG (animated PNG)". 
  25. ^
  26. ^ "Web specifications supported in Opera 9.5".  
  27. ^ "Support for animated PNG images in Opera browser.".  
  28. ^
  29. ^ "AVAnimator". 
  30. ^ "OmniGIF (APNG) Player". 
  31. ^
  32. ^ "APNG-canvas Library". 
  33. ^
  34. ^ Chunk Sequence Numbers (APNG spec)
  35. ^ Chunk Ordering Rules (PNG 1.2 spec)
  36. ^ "AniPNG Demonstration". 2008-12-08. 

External links

  • The APNG specification at Wiki
  • APNG patch for libpng
  • Mozilla's APNG Demo Site
  • Directory of APNG Software and Developers resources
  • APNG tests for browsers supporting APNG 1.0
  • APNG assembler: online PNG ➔ APNG converter
  • APNG extension for Google Chrome
  • APNG viewer utility for iOS
  • AJAX loading animations in APNG
  • Opera extension for APNG creation from screenshots
  • apngasm - FOSS Animated PNG tools and APNG standardization
  • - Web application for creating and editing APNG
  • Trying to add APNG support in native level of Chromium (also Android support)
  • APNG consideration in the Chromium development group
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from World eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.