APNG

File format

For other uses, see APNG (disambiguation).

Animated PNG

An animated PNG, or APNG, of a bouncing ball (displays as static image in some web browsers)

Filename extension|

`.png`, `.apng`

Internet media type|

`image/png`, `image/apng`, ~~`image/vnd.mozilla.apng`~~

Developed by| Mozilla Foundation (adopted by W3C)
Initial release| August 27, 2004; 19 years ago (2004-08-27)[1]
Type of format| animated lossless bitmap image
Extended from| PNG
Open format?| 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 24 or 48-bit images and full alpha transparency not available for GIFs. It also retains backward compatibility with non-animated PNG files.

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 extra animation 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 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[edit]

An APNG of an MRI scan of a human head

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.[1][2] 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);[3] 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.[4] 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)[5] while insisting on the use of the .png extension instead of .apng, leading to the format not being approved by the PNG Development Group.[6]

The PNG Development Group rejected APNG as an official extension on April 20, 2007,[7] and there have been several subsequent proposals for a simple animated graphics format based on PNG using several different approaches.[8] However, since September 14, 2021, the PNG Working Group has been charted 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.[9] The Candidate Recommendation was published on September 21, 2023.[10]

## File format[edit]

The APNG specification follows the PNG File format introducing three new ancillary chunks:[11]

* 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.[12]

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,[13] making APNG backwards compatible. Applications without support for the APNG extension show only the first frame, disregarding additional animation frames.

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

### Compression and Optimization[edit]

A number of optimization techniques make APNG files as small as possible: Inter-frame optimization [14] 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.[15]

### Derived formats[edit]

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).[which?][16]

## Support[edit]

See also: Comparison of web browsers § Image format support

The logo of APNG Assembler, free software to create APNG images

Mozilla Firefox added support for APNG in version 3 trunk builds on March 23, 2007.[17] 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.[18]

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.[19] In 2016, Apple adopted the APNG format as the preferred format for animated stickers in iOS 10 iMessage apps.[20] On March 15, 2017, APNG support was added to Chromium.[21]

List of computer programs and their support of APNG, along with their version numbers and release date  Field | Software | Supports? | Since

|
|
|

Image
processing | APNG Assembler  | Yes  | v. 1[22]
cphktool APNG Anime Maker  | Yes  | v. 1 (9 June 2009)[23]
APNG Disassembler  | Yes  | v. 1 [24]
APNG Optimizer  | Yes  | v. 1.0 (28 March 2011)[25]
Chasys Draw IES | Yes[26] | v. 5.17.05[27]
Clip Studio Paint | Yes  | v. 1.6.7 (7 September 2017)[28]
FFmpeg | Yes[29] | v. 2.7[30]
FireAlpaca [ja] | Yes  | v. 2.3.13[31]
Gamani GIF Movie Gear  | Yes  | v. 4.2 (March 2008)[32]
GID  | Read-only  | v. 11 (December 2023)[33]
GIMP | Needs plug-in[34] | —
Honeycam | Yes  | v. 3.48 (29 November 2021)[35]
Honeyview | Yes  | v. 5.10 (17 February 2015)[36]
ImageJ | Yes  | v. 1.41g (3 July 2008)[37]
ImageMagick | Yes  | v. 7.0.10-31 (20 September 2020)[38]
Imagine  | Yes  | v. 1.0.2 (4 May 2008)[39]
IrfanView | Read-only  | v. 4.40 (31 July 2015)
Konvertor  | Yes  | v. 4.02 (May 2010)[40]
KSquirrel (later SAIL)  | Read-only  | v. 0.7.2 (3 October 2007)[41]
Paint.NET | Needs plugin[42] | —
RealWorld Paint  | Yes  | v. 2011.1 (December 2011)[43]
VirtualDub | Needs plugin[44][a] | —
XnView | Read-only  | v. 1.97.4 (30 April 2010)[45]
Sciter and HTMLayout UI engines  | Read-only  | since 2008
Krita | Yes[46] | Krita Nightly 5.0.0 pre-alpha (since 22 February 2021)[47]
qView | Read-only  | v. 4.0 (31 October 2020)
Browser
engines | WebKit | Yes  | (17 March 2015)[48]
Blink | Yes  | June 2017
Web
browsers | Mozilla Firefox
(Gecko layout engine) | Yes  | v. 3 (17 June 2008)[49][50]
SeaMonkey
(Gecko layout engine) | Yes  | v. 2
Iceweasel and other Debian rebrandings
(Gecko layout engine) | Yes  | v. 4.0~b12[18]
Safari
(WebKit layout engine) | Yes  | v. 8.0[51]
Google Chrome and Chromium
(Blink layout engine) | Yes  | v. 59 (5 June 2017)[52][53]
Internet Explorer
(Trident layout engine) | No[51] | —
Microsoft Edge
(EdgeHTML layout engine) | No[51][54] | —
Microsoft Edge
(Blink layout engine) | Yes  | v. 79
Opera v12 and earlier
(Presto layout engine) | Yes  | v. 9.5 (12 June 2008)[55]
Opera 15 and later
(Blink layout engine) | Yes  | v. 46.0 (22 June 2017)[56]
Pale Moon (Goanna layout engine) | Yes  | v. 27
Mobile
browsers | iOS Safari | Yes[51] | v. 8.0
Firefox for Android | Yes[51] | ?
Samsung Internet for Android | Yes  | v. 7.0
Opera Mobile | Yes[citation needed] | ?
Productivity
software | LibreOffice | Yes[57] | Planned

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.[58] Examples of such browsers include Microsoft Edge and Internet Explorer 9.

## See also[edit]

* Multiple-image Network Graphics
* WebM
* WebP

## References[edit]

1. ^ a b "Add APNG support for Mozilla". Bugzilla. Mozilla Foundation. 27 August 2004. Retrieved 23 April 2024.
2. ^ Stuart Parmenter; Vladimir Vukicevic (2 September 2004). "APNG 0.4 [DRAFT]". Vladimir Vukicevic. Archived from the original on 19 November 2004. Retrieved 23 April 2024.
3. ^ martin (1999-11-11). "Bug 18574 - (mng) restore support for MNG animation format and JNG image format". Mozilla. Retrieved 2010-03-30.
4. ^ "PNG (Portable Network Graphics) Specification, Version 1.1#8.4. Multiple-image extension". libpng. Retrieved 2010-03-30.
5. ^ "APNG Specification, Version 1.0#MIME type". Mozilla. Retrieved 2017-12-10.
6. ^ "ImageMagick can't detect animated PNG". GitHub. Retrieved 2017-12-10.
7. ^ "VOTE FAILED: APNG 20070405a". SourceForge mailing list. 2007-04-20.
8. ^ "Discussion for a simple "animated" PNG format". Archived from the original on 2009-02-26. Retrieved 2011-07-12.
9. ^ "PNG Third Edition, Explained". W3C GitHub. 2023-05-24.
10. ^ "PNG Specification (Third Edition), APNG: frame-based animation". w3.org. 2023-09-21.
11. ^ "APNG Specification - MozillaWiki".
12. ^ Chunk Ordering Rules (PNG 1.2 spec)
13. ^ "Portable Network Graphics (PNG) Specification (Second Edition)".
14. ^ "Inter-frame Optimization in APNG". littlesvr.ca. Archived from the original on 2014-04-26. Retrieved 2021-10-21.
15. ^ "APNG Assembler". apngasm.sourceforge.net. Retrieved 2021-10-21.
16. ^ "Stickers". Signal Support. Signal. Retrieved 28 December 2021.
17. ^ "Gran Paradiso Alpha 3 release notes". Mozilla. 2007-03-23. Archived from the original on December 26, 2009. Retrieved 2010-03-30.
18. ^ a b "Debian Bug #486827 Iceweasel cannot render APNG image". Debian. 2011-08-26. Retrieved 2011-09-18.
19. ^ "Digital Audio Broadcasting (DAB); MOT SlideShow; User Application (pdf) Specification" (PDF). ETSI. Retrieved 30 January 2013.
20. ^ "Messaging - Extensions - iOS Human Interface Guidelines". developer.apple.com. Apple, Inc. Retrieved 2016-10-12.
21. ^ "Anzwix / Chromium / Add support for Animated PNG". Retrieved 2017-03-15.
22. ^ maxst (15 November 2017). "APNG Assembler". SourceForge.
23. ^ "cphktool APNG Anime Maker". cphktool. Archived from the original on 2010-02-09. Retrieved 2010-06-28.
24. ^ maxst. "APNG Disassembler". SourceForge.
25. ^ maxst. "APNG Optimizer". SourceForge.
26. ^ "Online Help for Chasys Draw IES: File Formats - Other Image Files".
27. ^ "Online Help for Chasys Draw IES: History". Retrieved 2022-07-18.
28. ^ "CLIP STUDIO PAINT Version 1.6.7 release notes (9/7/2017)". Retrieved 2024-04-22.
29. ^ "FFmpeg Formats Documentation".
30. ^ "GitHub changelog of FFmpeg". GitHub. Retrieved 2016-07-09.
31. ^ "FireAlpaca Update History". Retrieved 2021-09-04.
32. ^ "Animated PNG: Simple Animation with an Alpha Channel". Gamani. Retrieved 2009-08-25.
33. ^ "GID (Generic Image Decoder)". GitHub. Retrieved 2023-12-09.
34. ^ "APNG Plug-In". Archived from the original on 2014-05-25. Retrieved 2010-05-28.
35. ^ "Honeycam - Version history". Bandisoft International Inc. Retrieved 2022-01-09.
36. ^ "Honeyview - Version history". Bandisoft International Inc. Retrieved 2022-01-09.
37. ^ "ImageJ News". ImageJ. Archived from the original on May 21, 2009. Retrieved 2009-05-23.
38. ^ "ImageMagick - Changelog". Retrieved 2021-04-25.
39. ^ "Imagine - What's new". Archived from the original on October 8, 2011. Retrieved 2017-09-01.
40. ^ "Konvertor - Solutions for Multimedia Processing". Archived from the original on 2010-05-12. Retrieved 2010-05-19.
41. ^ "KSquirrel Codecs ChangeLog". GitHub. 15 October 2021.
42. ^ "Animated Image 2.4 - AGIF & APNG". Paint.NET Forum. 10 January 2009.
43. ^ "More about animated PNG - Vlasta's blog". www.rw-designer.com.
44. ^ "SourceForge.net: VirtualDub APNG Mod". vdubapngmod.sourceforge.net.
45. ^ While XnView is available for several operating systems, only versions for Windows have been released since APNG support was added.
46. ^ "APNG export support". Retrieved 2021-08-16.
47. ^ "APNG and WEBP animation export (dbe993da) · Commits · Graphics / Krita". GitLab. 22 February 2021. Retrieved 2021-08-16.
48. ^ "Animated PNG graphics". WebKit. Mar 17, 2015. Retrieved 2015-03-17.
49. ^ Parmenter, Stuart; Vladimir Vukicevic; Andrew Smith (July 4, 2008). "Animated PNG graphics". Mozilla Developer Center. Mozilla. Archived from the original on 2008-12-04. Retrieved 2009-05-23.
50. ^ "Firefox 3 for developers". Mozilla Developer Center. Mozilla. October 1, 2008. Archived from the original on 2008-11-13. Retrieved 2009-05-23.
51. ^ a b c d e "Animated PNG (APNG)". Can I use... Support tables for HTML5, CSS3, etc.
52. ^ "7d2b8c45afc9c0230410011293cc2e1dbb8943a7 - chromium/src - Git at Google". chromium.googlesource.com.
53. ^ "Stable Channel Update for Desktop". Chrome Releases. Retrieved 2017-06-06.
54. ^ "The status of APNG image format in Microsoft Edge". Microsoft Edge Development. Retrieved 2017-07-29.
55. ^ "Web specifications supported in Opera 9.5". Opera Software. Archived from the original on 2009-02-25. Retrieved 2009-05-23.
56. ^ "Opera 46 goes final, more quality and Opera's first TV ad". Opera Software. 22 June 2017. Retrieved 2017-06-26.
57. ^ "Projects selected for LibreOffice in the Google Summer of Code 2023: Add APNG import/export support". LibreOffice. 29 May 2023. Retrieved 2023-05-29.
58. ^ "APNG-canvas Library". GitHub. 11 October 2021.

## External links[edit]

Wikimedia Commons has media related to Animated PNG files.

* APNG from the PNG Specification (3rd Edition)
* The APNG specification at mozilla.org's 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
* AJAX loading animations in APNG
* APNG consideration in the Chromium development group

* v
* t
* e

Graphics file formats

Raster|

* ANI
* ANIM
* APNG
* ART
* AVIF
* BMP
* BPG
* BSAVE
* CAL
* CIN
* CPC
* CPT
* DDS
* DPX
* ECW
* EXR
* FITS
* FLIC
* FLIF
* FPX
* GIF
* HDRi
* HEVC
* ICER
* ICNS
* ICO / CUR
* ICS
* ILBM
* JBIG
* JBIG2
* JNG
* JPEG
* JPEG-LS
* JPEG 2000
* JPEG XL
* JPEG XR
* JPEG XS
* JPEG XT
* JPEG-HDR
* KRA
* MNG
* MIFF
* NRRD
* ORA
* PAM
* PBM / PGM / PPM / PNM
* PCX
* PGF
* PICtor
* PNG
* PSD / PSB
* PSP
* QOI
* QTVR
* RAS
* RGBE
* Logluv TIFF
* SGI
* TGA
* TIFF
* TIFF/EP
* TIFF/IT
* UFO / UFP
* WBMP
* WebP
* XBM
* XCF
* XPM
* XWD

Raw|

* CIFF
* DNG

Vector|

* AI
* CDR
* CGM
* DXF
* EVA
* EMF
* EMF+
* Gerber
* HVIF
* IGES
* PGML
* SVG
* VML
* WMF
* Xar

Compound|

* CDF
* DjVu
* EPS
* PDF
* PICT
* PS
* SWF
* XAML

Metadata|

* Exchangeable image file format (Exif)
* International Press Telecommunications Council § Photo metadata
* Extensible Metadata Platform (XMP)
* GIF § Metadata
* Steganography

* Category
* Comparison

* v
* t
* e

Multimedia compression and container formats

Video
compression|

| ISO, IEC,
MPEG|

* DV
* MJPEG
* Motion JPEG 2000
* MPEG-1
* MPEG-2
* Part 2
* MPEG-4
* Part 2 / ASP
* Part 10 / AVC
* Part 33 / IVC
* MPEG-H
* Part 2 / HEVC
* MPEG-I
* Part 3 / VVC
* MPEG-5
* Part 1 / EVC
* Part 2 / LCEVC

|

ITU-T, VCEG|

* H.120
* H.261
* H.262
* H.263
* H.264 / AVC
* H.265 / HEVC
* H.266 / VVC

SMPTE|

* VC-1
* VC-2
* VC-3
* VC-5
* VC-6

TrueMotion|

* TrueMotion S
* VP3
* VP6
* VP7
* VP8
* VP9
* AV1

Others|

* Apple Video
* AVS
* Bink
* Cinepak
* Daala
* DVI
* FFV1
* Huffyuv
* Indeo
* Lagarith
* Microsoft Video 1
* MSU Lossless
* OMS Video
* Pixlet
* ProRes
* 422
* 4444
* QuickTime
* Animation
* Graphics
* RealVideo
* RTVideo
* SheerVideo
* Smacker
* Sorenson Video/Spark
* Theora
* Thor
* Ut
* WMV
* XEB
* YULS

Audio
compression|

| ISO, IEC,
MPEG|

* MPEG-1 Layer II
* Multichannel
* MPEG-1 Layer I
* MPEG-1 Layer III (MP3)
* AAC
* HE-AAC
* AAC-LD
* MPEG Surround
* MPEG-4 ALS
* MPEG-4 SLS
* MPEG-4 DST
* MPEG-4 HVXC
* MPEG-4 CELP
* MPEG-D USAC
* MPEG-H 3D Audio

|

ITU-T|

* G.711
* A-law
* µ-law
* G.718
* G.719
* G.722
* G.722.1
* G.722.2
* G.723
* G.723.1
* G.726
* G.728
* G.729
* G.729.1

IETF|

* Opus
* iLBC
* Speex
* Vorbis

3GPP|

* AMR
* AMR-WB
* AMR-WB+
* EVRC
* EVRC-B
* EVS
* GSM-HR
* GSM-FR
* GSM-EFR

ETSI|

* AC-3
* AC-4
* DTS

Bluetooth SIG|

* SBC
* LC3

Others|

* ACELP
* ALAC
* Asao
* ATRAC
* AVS
* CELT
* Codec 2
* DRA
* FLAC
* iSAC
* Lyra
* MELP
* Monkey's Audio
* MT9
* Musepack
* OptimFROG
* OSQ
* QCELP
* RCELP
* RealAudio
* RTAudio
* SD2
* SHN
* SILK
* Siren
* SMV
* SVOPC
* TTA
* True Audio
* TwinVQ
* VMR-WB
* VSELP
* WavPack
* WMA
* MQA
* aptX
* aptX HD
* aptX Low Latency
* aptX Adaptive
* LDAC
* LHDC
* LLAC
* L2HC

Image
compression|

| IEC, ISO, IETF,
W3C, ITU-T, JPEG|

* CCITT Group 4
* GIF
* HEIC / HEIF
* HEVC
* JBIG
* JBIG2
* JPEG
* JPEG 2000
* JPEG-LS
* JPEG XL
* JPEG XR
* JPEG XS
* JPEG XT
* PNG
* TIFF
* TIFF/EP
* TIFF/IT

|

Others|

* APNG
* AV1
* AVIF
* BPG
* DjVu
* EXR
* FLIF
* ICER
* MNG
* PGF
* QOI
* QTVR
* WBMP
* WebP

Containers|

| ISO, IEC|

* MPEG-ES
* MPEG-PES
* MPEG-PS
* MPEG-TS
* ISO/IEC base media file format
* MPEG-4 Part 14 (MP4)
* Motion JPEG 2000
* MPEG-21 Part 9
* MPEG media transport

|

ITU-T|

* H.222.0
* T.802

IETF|

* RTP
* Ogg

SMPTE|

* GXF
* MXF

Others|

* 3GP and 3G2
* AMV
* ASF
* AIFF
* AVI
* AU
* BPG
* Bink
* Smacker
* BMP
* DivX Media Format
* EVO
* Flash Video
* HEIF
* IFF
* M2TS
* Matroska
* WebM
* QuickTime File Format
* RatDVD
* RealMedia
* RIFF
* WAV
* MOD and TOD
* VOB, IFO and BUP

Collaborations|

* NETVC
* MPEG LA
* Alliance for Open Media

Methods|

* Entropy
* Arithmetic
* Huffman
* Modified
* LPC
* ACELP
* CELP
* LSP
* WLPC
* Lossless
* Lossy
* LZ
* DEFLATE
* LZW
* PCM
* A-law
* µ-law
* ADPCM
* DPCM
* Transforms
* DCT
* FFT
* MDCT
* Wavelet
* Daubechies
* DWT

Lists|

* Comparison of audio coding formats
* Comparison of video codecs
* List of codecs

See Compression methods for techniques and Compression software for codecs
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template