Animated Portable Network Graphics (APNG) is a
file format
A file format is a Computer standard, standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary format, pr ...
which extends the
Portable Network Graphics
Portable Network Graphics (PNG, officially pronounced , colloquially pronounced ) is a raster graphics, raster-graphics file graphics file format, format that supports lossless data compression. PNG was developed as an improved, non-patented ...
(PNG) specification to permit
animated
Animation is a filmmaking technique whereby image, still images are manipulated to create Motion picture, moving images. In traditional animation, images are drawn or painted by hand on cel, transparent celluloid sheets to be photographed and e ...
images that work similarly to animated
GIF
The Graphics Interchange Format (GIF; or , ) is a Raster graphics, bitmap Image file formats, image format that was developed by a team at the online services provider CompuServe led by American computer scientist Steve Wilhite and released ...
files, while supporting 24 or 48-bit images and
full alpha transparency not available for GIFs. It also retains
backward compatibility
In telecommunications and computing, backward compatibility (or backwards compatibility) is a property of an operating system, software, real-world product, or technology that allows for interoperability with an older legacy system, or with Input ...
with non-animated PNG files.
The first
frame
A frame is often a structural system that supports other components of a physical construction and/or steel frame that limits the construction's extent.
Frame and FRAME may also refer to:
Physical objects
In building construction
*Framing (con ...
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 competed with
Multiple-image Network Graphics
Multiple-image Network Graphics (MNG) is a graphics file format published in 2001 for animated images. Its specification is publicly documented and there are free software reference implementations available.
MNG is closely related to the PNG ...
(MNG), a comprehensive format for bitmapped animations which was created by the same team as PNG and is obsolete. APNG's advantage was the smaller library size and compatibility with older PNG implementations.
History and development
The APNG specification was created in 2004 by Stuart Parmenter and
Vladimir Vukićević
Vladimir Vukićević (born 29 April 1979), is a Serbian-born American software engineer who has worked on many open source projects. He is known mostly for his work on open-source graphics libraries, including those used in the Mozilla project, ...
of the
Mozilla Corporation
The Mozilla Corporation is a wholly owned subsidiary of the Mozilla Foundation that coordinates and integrates the development of Internet-related applications such as the Firefox web browser, by a global community of open-source developers, s ...
to allow for storing the animations needed for interfaces such as
throbber
A throbber, also known as a loading icon, is an animated graphical control element used to show that a computer program is performing an action in the background (such as downloading content, conducting intensive calculations or communicating wi ...
s.
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
In information and communications technology, a media type, content type or MIME type is a two-part identifier for file formats and content formats. Their purpose is comparable to filename extensions and uniform type identifiers, in that they ide ...
(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
The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. Founded in 1994 by Tim Berners-Lee, the consortium is made up of member organizations that maintain full-time staff working together in ...
(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.
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.
[Chunk Ordering Rules](_blank)
(PNG 1.2 spec)
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
In telecommunications and computing, backward compatibility (or backwards compatibility) is a property of an operating system, software, real-world product, or technology that allows for interoperability with an older legacy system, or with inpu ...
. Applications without support for the APNG extension show only the first frame, disregarding additional animation frames.
Compression and optimization
A number of optimization techniques make APNG files as small as possible:
Inter-frame
An inter frame is a frame in a video compression stream which is expressed in terms of one or more neighboring frames. The "inter" part of the term refers to the use of ''Inter frame prediction''. This kind of prediction tries to take advantage fr ...
optimization utilizing
alpha-blend and alpha dispose operations, smaller than the full-size subframes, dirty transparency, color type and
color palette
In color theory, a color scheme is a combination of 2 or more colors used in aesthetic or practical design. Aesthetic color schemes are used to create style and appeal. Colors that create a color harmony, harmonious feeling when viewed togethe ...
optimizations, and various compression options:
zlib
zlib ( or "zeta-lib", ) is a software library used for data compression as well as a data format. zlib was written by Jean-loup Gailly and Mark Adler and is an abstraction of the DEFLATE compression algorithm used in their gzip file compre ...
,
7-Zip
7-Zip is a free and open-source file archiver, a utility used to place groups of files within compressed containers known as "archives". It is developed by Igor Pavlov and was first released in 1999. 7-Zip has its own Archive file, archive forma ...
,
Zopfli
Zopfli is a data compression library that performs Deflate, gzip and zlib data encoding. It achieves higher compression ratios than mainstream Deflate and zlib implementations at the cost of being slower. Google
Google LLC (, ) is an A ...
.
Derived formats
Animated
sticker
A sticker is a type of label: a piece of printed paper, plastic, vinyl, or other material with temporary or permanent pressure sensitive adhesive on one side. It can be used for decoration or for functional purposes, depending on the situation. ...
s for
Signal
A signal is both the process and the result of transmission of data over some media accomplished by embedding some variation. Signals are important in multiple subject fields including signal processing, information theory and biology.
In ...
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
Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements curren ...
added support for APNG in
version 3 trunk builds on March 23, 2007. However, because libpng is the PNG Group's
reference implementation
In the software development process, a reference implementation (or, less frequently, sample implementation or model implementation) is a program that implements all requirements from a corresponding specification. The 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.
In 2008
WorldDMB
WorldDAB is a global industry non-profit organisation responsible for defining the standards of the ''Eureka-147'' family, which includes the DAB (Digital Audio Broadcasting) and DAB+ standards of digital radio. WorldDAB oversees the DAB/DAB+ stan ...
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
The European Telecommunications Standards Institute (ETSI) is an independent, not-for-profit, standardization organization operating in the field of Information and communications technology, information and communications. ETSI supports the de ...
standard TS 101 499 V2.2.1. In 2016,
Apple
An apple is a round, edible fruit produced by an apple tree (''Malus'' spp.). Fruit trees of the orchard or domestic apple (''Malus domestica''), the most widely grown in the genus, are agriculture, cultivated worldwide. The tree originated ...
adopted the APNG format as the preferred format for animated stickers in
iOS 10
iOS 10 is the iOS version history, tenth major release of the iOS mobile operating system developed by Apple Inc., being the successor to iOS 9. It was announced at the company's Worldwide Developers Conference on June 13, 2016, and was release ...
iMessage
iMessage is an instant messaging service developed by Apple Inc. and launched in 2011. iMessage functions exclusively on Apple platforms – including iOS, iPadOS, macOS, watchOS, and visionOS – as part of Apple ecosystem, Apple's approach t ...
apps. On March 15, 2017, APNG support was added to
Chromium
Chromium is a chemical element; it has Symbol (chemistry), symbol Cr and atomic number 24. It is the first element in Group 6 element, group 6. It is a steely-grey, Luster (mineralogy), lustrous, hard, and brittle transition metal.
Chromium ...
.
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.
See also
*
Multiple-image Network Graphics
Multiple-image Network Graphics (MNG) is a graphics file format published in 2001 for animated images. Its specification is publicly documented and there are free software reference implementations available.
MNG is closely related to the PNG ...
*
WebM
WebM is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML video and the HTML audio elements. It has a sister project, WebP, for images. The development of the format is sponsored by ...
*
WebP
WebP is a raster graphics file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression, as well as animation and alpha transparency.
Google announced the WebP ...
References
External links
APNG from the PNG Specification (3rd Edition)*
The APNG specification at
mozilla.org's
Wiki
A wiki ( ) is a form of hypertext publication on the internet which is collaboratively edited and managed by its audience directly through a web browser. A typical wiki contains multiple pages that can either be edited by the public or l ...
APNG patch for libpngDirectory of APNG Software and Developers resources*
ttps://loadingapng.com AJAX loading animations in APNGAPNG consideration in the Chromium development group
{{Compression formats
Animated graphics file formats
Graphics file formats
Computer-related introductions in 2004
Mozilla
Open file formats
Portable Network Graphics