ArticleslgStudy

computer science

APNG

APNG is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand APNG rather than just read about it. In short: 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.

APNG — main illustration
APNG — illustration

Key takeaways

  • APNG belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect APNG to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of APNG from memory before moving on to harder problems.

Reference excerpt

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 20 April 2007, and there have been several subsequent proposals for a simple animated graphics format based on PNG using several different approaches. However, since 14 September 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 25 October 2022, adding APNG extensions to the core PNG specification. The Candidate Recommendation was published on 21 September 2023. On 24 June 2025 it was finally elevated to the Recommendation final status by the W3C.

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 the resolution must be 512x512px).

Support

Mozilla Firefox added support for APNG in version 3 trunk builds on 23 March 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 15 March 2017, APNG support was added to 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 WebM WebP AVIF GIF SVG DNG

References

External links

… excerpt ends here. Continue reading the full article.

Illustrations

APNG: Diagram illustrating a possible way to assemble an animated PNG from three individual PNG files
Diagram illustrating a possible way to assemble an animated PNG from three individual PNG files
APNG: The logo of APNG Assembler, free software to create APNG images
The logo of APNG Assembler, free software to create APNG images

Worked examples

Example 1 — a first encounter with APNG

Start with the simplest possible case. Write down what APNG claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to APNG before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about APNG ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of APNG

In research
APNG appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses APNG in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
APNG is common in secondary-school and first-year university syllabi. It links to neighbouring topics Animated graphics file formats, Computer-related introductions in 2004, Mozilla, so understanding it makes those chapters shorter.
In everyday life
Look for APNG outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “APNG” →

How to study APNG in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what APNG means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain APNG out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is APNG in simple terms?

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 al…

Why does APNG matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study APNG?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on APNG.

Tags

  • Animated graphics file formats
  • Computer-related introductions in 2004
  • Mozilla
  • Open file formats
  • Portable Network Graphics
  • Raster graphics file formats
  • World Wide Web Consortium standards

Keep exploring