APNG

{{short description|File format}}

{{other uses}}

{{Infobox file format

| name = Animated PNG

| icon =

| screenshot = file:Animated PNG example bouncing beach ball.png

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

| extension = {{code|.png}}, {{code|.apng}}

| mime = {{code|image/png}}, {{code|image/apng}}, {{code|image/vnd.mozilla.apng}}

| owner = Mozilla Foundation (adopted by W3C)

| creatorcode =

| genre = animated lossless bitmap image

| containerfor =

| containedby =

| released = {{start date and age|2004|08|27}}{{cite web |title=Add APNG support for Mozilla |url=https://bugzilla.mozilla.org/show_bug.cgi?id=257197 |website=Bugzilla |publisher=Mozilla Foundation |access-date=23 April 2024 |date=27 August 2004}}

| extendedfrom = PNG

| extendedto =

| open = yes

| url =

}}

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

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.{{cite web |author1=Stuart Parmenter |author2=Vladimir Vukicevic |title=APNG 0.4 [DRAFT] |url=http://www.vlad1.com/~vladimir/projects/apng/AnimatedPNG.html |publisher=Vladimir Vukicevic |access-date=23 April 2024 |archive-url=https://web.archive.org/web/20041119231831/http://www.vlad1.com/~vladimir/projects/apng/AnimatedPNG.html |archive-date=19 November 2004 |date=2 September 2004}} 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);{{Cite web |last=martin |date=1999-11-11 |title=Bug 18574 - (mng) restore support for MNG animation format and JNG image format |url=https://bugzilla.mozilla.org/show_bug.cgi?id=18574#c72 |access-date=2010-03-30 |publisher=Mozilla}} 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.{{Cite web |title=PNG (Portable Network Graphics) Specification, Version 1.1#8.4. Multiple-image extension |url=http://www.libpng.org/pub/png/spec/1.1/PNG-Misc.html#Multiple-image-extension |access-date=2010-03-30 |publisher=libpng}} 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){{Cite web |title=APNG Specification, Version 1.0#MIME type |url=https://wiki.mozilla.org/APNG_Specification#MIME_type |access-date=2017-12-10 |publisher=Mozilla}} while insisting on the use of the .png extension instead of .apng, leading to the format not being approved by the PNG Development Group.{{Cite web |title=ImageMagick can't detect animated PNG |url=https://github.com/ImageMagick/ImageMagick/issues/24#issuecomment-136362187 |access-date=2017-12-10 |website=GitHub}}

The PNG Development Group rejected APNG as an official extension on April 20, 2007,{{Cite web |date=2007-04-20 |title=VOTE FAILED: APNG 20070405a |url=https://sourceforge.net/mailarchive/message.php?msg_id=131482 |publisher=SourceForge mailing list}} and there have been several subsequent proposals for a simple animated graphics format based on PNG using several different approaches.{{Cite web |title=Discussion for a simple "animated" PNG format |url=http://gjuyn.xs4all.nl/pnganim.html |archive-url=https://web.archive.org/web/20090226103407/http://gjuyn.xs4all.nl/pnganim.html |archive-date=2009-02-26 |access-date=2011-07-12}} 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.{{Cite web |date=2023-05-24 |title=PNG Third Edition, Explained |url=https://github.com/w3c/PNG-spec/blob/d5b059ad7f81e789b7689f1c0479db8d1cb41fb8/Third_Edition_Explainer.md#apng |website=W3C GitHub}} The Candidate Recommendation was published on September 21, 2023.{{Cite web |date=2023-09-21 |title=PNG Specification (Third Edition), APNG: frame-based animation |url=https://www.w3.org/TR/png/#apng-frame-based-animation |website=w3.org}}

File format

The APNG specification follows the PNG File format introducing three new ancillary chunks:{{Cite web |title=APNG Specification - MozillaWiki |url=https://wiki.mozilla.org/APNG_Specification}}

  • 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.[http://www.libpng.org/pub/png/spec/1.2/PNG-Ordering.html Chunk Ordering Rules] (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,{{Cite web |title=Portable Network Graphics (PNG) Specification (Second Edition) |url=https://www.w3.org/TR/PNG/}} making APNG backwards compatible. Applications without support for the APNG extension show only the first frame, disregarding additional animation frames.

Image:Apng assembling.svg

= Compression and optimization =

A number of optimization techniques make APNG files as small as possible: Inter-frame optimization {{Cite web |title=Inter-frame Optimization in APNG |url=http://littlesvr.ca/apng/inter-frame.html |url-status=live |archive-url=https://web.archive.org/web/20140426100136/http://littlesvr.ca:80/apng/inter-frame.html |archive-date=2014-04-26 |access-date=2021-10-21 |website=littlesvr.ca}} 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.{{Cite web |title=APNG Assembler |url=https://apngasm.sourceforge.net/ |access-date=2021-10-21 |website=apngasm.sourceforge.net}}

=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).{{Which|date=January 2024}}{{Cite web |title=Stickers |url=https://support.signal.org/hc/en-us/articles/360031836512-Stickers#sticker_reqs |access-date=28 December 2021 |website=Signal Support |publisher=Signal |language=en}}

Support

{{See also|Comparison of web browsers#Image format support}}

File:APNG Assembler Logo.svg to create APNG images]]

Mozilla Firefox added support for APNG in version 3 trunk builds on March 23, 2007.{{Cite web |date=2007-03-23 |title=Gran Paradiso Alpha 3 release notes |url=https://www.mozilla.org/projects/firefox/3.0a3/releasenotes/ |url-status=dead |archive-url=https://web.archive.org/web/20091226221450/http://www.mozilla.org/projects/firefox/3.0a3/releasenotes/ |archive-date=December 26, 2009 |access-date=2010-03-30 |publisher=Mozilla}} 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.{{Cite web |date=2011-08-26 |title=Debian Bug #486827 Iceweasel cannot render APNG image |url=https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=486827#43 |access-date=2011-09-18 |publisher=Debian}}

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.{{Cite web |title=Digital Audio Broadcasting (DAB); MOT SlideShow; User Application (pdf) Specification |url=https://www.etsi.org/deliver/etsi_ts/101400_101499/101499/02.02.01_60/ts_101499v020201p.pdf |access-date=30 January 2013 |publisher=ETSI}} In 2016, Apple adopted the APNG format as the preferred format for animated stickers in iOS 10 iMessage apps.{{Cite web |title=Messaging - Extensions - iOS Human Interface Guidelines |url=https://developer.apple.com/ios/human-interface-guidelines/extensions/messaging/ |access-date=2016-10-12 |website=developer.apple.com |publisher=Apple, Inc.}} On March 15, 2017, APNG support was added to Chromium.{{Cite web |title=Anzwix / Chromium / Add support for Animated PNG |url=http://anzwix.com/a/Chromium/Add%20Support%20For%20Animated%20PNG |access-date=2017-03-15}}

class = "wikitable"

|+ List of computer programs and their support of APNG, along with their version numbers and release date

FieldSoftwareSupports?Since
rowspan="27" | Image
processing

| APNG Assembler

| {{yes}}

| v. 1{{Cite web |last=maxst |date=15 November 2017 |title=APNG Assembler |url=https://sourceforge.net/projects/apngasm/ |website=SourceForge}}

cphktool APNG Anime Maker

| {{yes}}

| v. 1 (9 June 2009){{Cite web |title=cphktool APNG Anime Maker |url=http://sites.google.com/site/cphktool/apng-anime-maker |url-status=dead |archive-url=https://web.archive.org/web/20100209203257/http://sites.google.com/site/cphktool/apng-anime-maker |archive-date=2010-02-09 |access-date=2010-06-28 |publisher=cphktool}}

APNG Disassembler

| {{yes}}

| v. 1 {{Cite web |last=maxst |title=APNG Disassembler |url=https://apngdis.sourceforge.net/ |website=SourceForge}}

APNG Optimizer

| {{yes}}

| v. 1.0 (28 March 2011){{Cite web |last=maxst |title=APNG Optimizer |url=https://sourceforge.net/projects/apng/files/APNG_Optimizer/ |website=SourceForge}}

Chasys Draw IES

| {{yes}}{{Cite web |title=Online Help for Chasys Draw IES: File Formats - Other Image Files |url=https://www.jpchacha.com/chasysdraw/help.php?file=files_image.htm}}

| v. 5.17.05{{Cite web |title=Online Help for Chasys Draw IES: History |url=https://www.jpchacha.com/chasysdraw/help.php?file=history.htm#changelog |access-date=2022-07-18}}

Clip Studio Paint

| {{yes}}

| v. 1.6.7 (7 September 2017){{Cite web |title=CLIP STUDIO PAINT Version 1.6.7 release notes (9/7/2017) |url=https://www.clipstudio.net/en/dl/release_note/#167 |access-date=2024-04-22}}

FFmpeg

| {{yes}}{{Cite web |title=FFmpeg Formats Documentation |url=https://www.ffmpeg.org/ffmpeg-formats.html#apng}}

| v. 2.7{{Cite web |title=GitHub changelog of FFmpeg |url=https://github.com/FFmpeg/FFmpeg/blob/master/Changelog |access-date=2016-07-09 |website=GitHub}}

{{Interlanguage link|FireAlpaca|ja|FireAlpaca}}

| {{yes}}

| v. 2.3.13{{Cite web |title=FireAlpaca Update History |url=https://firealpaca.com/download/#history |access-date=2021-09-04}}

Gamani GIF Movie Gear

| {{yes}}

| v. 4.2 (March 2008){{Cite web |title=Animated PNG: Simple Animation with an Alpha Channel |url=https://www.gamani.com/apng.htm |access-date=2009-08-25 |publisher=Gamani}}

GID

| {{partial|Read-only}}

| v. 11 (December 2023){{Cite web |title=GID (Generic Image Decoder) |url=https://github.com/zertovitch/gid |access-date=2023-12-09 |website=GitHub}}

GIMP

| {{Needs|Needs plug-in}}{{Cite web |title=APNG Plug-In |url=http://registry.gimp.org/node/24394 |url-status=dead |archive-url=https://web.archive.org/web/20140525213646/http://registry.gimp.org/node/24394 |archive-date=2014-05-25 |access-date=2010-05-28}}

| {{N/A}}

Honeycam

| {{yes}}

| v. 3.48 (29 November 2021){{Cite web |title=Honeycam - Version history |url=https://www.bandisoft.com/honeycam/history/ |access-date=2022-01-09 |publisher=Bandisoft International Inc.}}

Honeyview

| {{yes}}

| v. 5.10 (17 February 2015){{Cite web |title=Honeyview - Version history |url=https://www.bandisoft.com/honeyview/history/ |access-date=2022-01-09 |publisher=Bandisoft International Inc.}}

ImageJ

| {{yes}}

| v. 1.41g (3 July 2008){{Cite web |title=ImageJ News |url=http://rsb.info.nih.gov/ij/notes.html |url-status=live |archive-url=https://web.archive.org/web/20090521092716/http://rsb.info.nih.gov/ij/notes.html |archive-date=May 21, 2009 |access-date=2009-05-23 |publisher=ImageJ}}

ImageMagick

| {{yes}}

| v. 7.0.10-31 (20 September 2020){{Cite web |title=ImageMagick - Changelog |url=https://imagemagick.org/script/changelog.php |access-date=2021-04-25}}

Imagine

| {{yes}}

| v. 1.0.2 (4 May 2008){{Cite web |title=Imagine - What's new |url=http://nyam.pe.kr/dev/imagine/doc/Whatsnew.txt |url-status=live |archive-url=https://web.archive.org/web/20111008163945/http://nyam.pe.kr/dev/imagine/doc/Whatsnew.txt |archive-date=October 8, 2011 |access-date=2017-09-01}}

IrfanView

| {{partial|Read-only}}

| v. 4.40 (31 July 2015)

Konvertor

| {{yes}}

| v. 4.02 (May 2010){{Cite web |title=Konvertor - Solutions for Multimedia Processing |url=http://www.konvertor.net/indexe.html |url-status=dead |archive-url=https://web.archive.org/web/20100512174247/http://www.konvertor.net/indexe.html |archive-date=2010-05-12 |access-date=2010-05-19}}

KSquirrel (later SAIL)

| {{partial|Read-only}}

| v. 0.7.2 (3 October 2007){{Cite web |date=15 October 2021 |title=KSquirrel Codecs ChangeLog |url=https://github.com/smoked-herring/sail/blob/master/CHANGELOG.md |website=GitHub}}

Paint.NET

| {{Needs|Needs plugin}}{{Cite web |date=7 January 2022 |title='PNG Animations and Images' FileType Plugin (.PNG, .APNG) [Latest v1.4 2022-01-07] |url=https://forums.getpaint.net/topic/119210-png-animations-and-images-filetype-plugin-png-apng-latest-v14-2022-01-07/ |website=Paint.NET Forum}}

| {{N/A}}

PhotoLine

| {{yes}}

|v19.5 (11 March 2016)

RealWorld Paint

| {{yes}}

| v. 2011.1 (December 2011){{Cite web |title=More about animated PNG - Vlasta's blog |url=http://www.rw-designer.com/entry/390 |website=www.rw-designer.com}}

VirtualDub

| {{Needs|Needs plugin}}{{Cite web |title=SourceForge.net: VirtualDub APNG Mod |url=https://vdubapngmod.sourceforge.net/ |website=vdubapngmod.sourceforge.net}}{{efn|After loading a video, an APNG file can be created via the "File{{!}}Export{{!}}Animated PNG" menu item.}}

| {{N/A}}

XnView

| {{partial|Read-only}}

| v. 1.97.4 (30 April 2010)While XnView is available for several operating systems, only versions for Windows have been released since APNG support was added.

Sciter and HTMLayout UI engines

| {{partial|Read-only}}

| since 2008

Krita

| {{yes}}{{Cite web |title=APNG export support |url=https://bugs.kde.org/show_bug.cgi?id=342479 |access-date=2021-08-16}}

| Krita Nightly 5.0.0 pre-alpha (since 22 February 2021){{Cite web |date=22 February 2021 |title=APNG and WEBP animation export (dbe993da) · Commits · Graphics / Krita |url=https://invent.kde.org/graphics/krita/-/commit/dbe993da3d369fc850553173ba55a3d2c8981917 |access-date=2021-08-16 |website=GitLab |language=en}}

qView

| {{partial|Read-only}}

| v. 4.0 (31 October 2020)

rowspan = "2" | Browser
engines

| WebKit

| {{yes}}

| (17 March 2015){{Cite web |date=Mar 17, 2015 |title=Animated PNG graphics |url=https://trac.webkit.org/changeset/181632 |access-date=2015-03-17 |publisher=WebKit}}

Blink

| {{yes}}

| June 2017

rowspan = "11" | Web
browsers

| Mozilla Firefox
(Gecko layout engine)

| {{yes}}

| v. 3 (17 June 2008){{Cite web |last1=Parmenter |first1=Stuart |last2=Vladimir Vukicevic |last3=Andrew Smith |date=July 4, 2008 |title=Animated PNG graphics |url=https://developer.mozilla.org/en/Animated_PNG_graphics |url-status=dead |archive-url=https://web.archive.org/web/20081204080959/https://developer.mozilla.org/en/Animated_PNG_graphics |archive-date=2008-12-04 |access-date=2009-05-23 |website=Mozilla Developer Center |publisher=Mozilla}}{{Cite web |date=October 1, 2008 |title=Firefox 3 for developers |url=https://developer.mozilla.org/en/Firefox_3_for_developers |url-status=dead |archive-url=https://web.archive.org/web/20081113072436/https://developer.mozilla.org/en/Firefox_3_for_developers |archive-date=2008-11-13 |access-date=2009-05-23 |website=Mozilla Developer Center |publisher=Mozilla}}

SeaMonkey
(Gecko layout engine)

| {{yes}}

| v. 2

Iceweasel and other Debian rebrandings
(Gecko layout engine)

| {{yes}}

| v. 4.0~b12

Safari
(WebKit layout engine)

| {{yes}}

| v. 8.0{{Cite web |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)

| {{yes}}

| v. 59 (5 June 2017){{Cite web |title=7d2b8c45afc9c0230410011293cc2e1dbb8943a7 - chromium/src - Git at Google |url=https://chromium.googlesource.com/chromium/src/+/7d2b8c45afc9c0230410011293cc2e1dbb8943a7 |website=chromium.googlesource.com}}{{Cite news |title=Stable Channel Update for Desktop |url=https://chromereleases.googleblog.com/2017/06/stable-channel-update-for-desktop.html |access-date=2017-06-06 |work=Chrome Releases |language=en-US}}

Internet Explorer
(Trident layout engine)

| {{no}}

| {{N/A}}

Microsoft Edge [Legacy]
(EdgeHTML layout engine)

| {{no}}{{Cite web |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}}

| {{N/A}}

Microsoft Edge
(Blink layout engine)

| {{yes}}

| v. 79

Opera v12 and earlier
(Presto layout engine)

| {{Yes}}

| v. 9.5 (12 June 2008){{Cite web |title=Web specifications supported in Opera 9.5 |url=http://www.opera.com/docs/specs/opera95/#graphics |url-status=dead |archive-url=https://web.archive.org/web/20090225070319/http://www.opera.com/docs/specs/opera95/#graphics |archive-date=2009-02-25 |access-date=2009-05-23 |publisher=Opera Software}}

Opera 15 and later
(Blink layout engine)

| {{Yes}}

| v. 46.0 (22 June 2017){{Cite web |date=22 June 2017 |title=Opera 46 goes final, more quality and Opera's first TV ad |url=http://blogs.opera.com/desktop/2017/06/opera-46-goes-final-more-quality-and-operas-first-tv-ad/ |access-date=2017-06-26 |publisher=Opera Software}}

Pale Moon (Goanna layout engine)

| {{Yes}}

| v. 27

rowspan = "4" | Mobile
browsers

| iOS Safari

| {{yes}}

| v. 8.0

Firefox for Android

| {{yes}}

| {{dunno}}

Samsung Internet for Android

| {{yes}}

| v. 7.0

Opera Mobile

| {{yes}}{{Citation needed|date=November 2017}}

| {{Dunno}}

rowspan = "1" | Productivity
software

| LibreOffice

| {{yes}}{{Cite web |date=29 May 2023 |title=Projects selected for LibreOffice in the Google Summer of Code 2023: Add APNG import/export support |url=https://blog.documentfoundation.org/blog/2023/05/29/projects-selected-for-libreoffice-in-the-google-summer-of-code-2023/ |access-date=2023-05-29 |publisher=LibreOffice}}

| Planned

{{notelist}}

A server-side library exists that allows web browsers that support the canvas tag, but do not support APNG, to display APNGs.{{Cite web |date=11 October 2021 |title=APNG-canvas Library |url=https://github.com/davidmz/apng-canvas |website=GitHub}} Examples of such browsers include Microsoft Edge Legacy and Internet Explorer 9.

See also

References

{{Reflist|30em}}