Английская Википедия:APNG

Материал из Онлайн справочника
Версия от 04:22, 27 декабря 2023; EducationBot (обсуждение | вклад) (Новая страница: «{{Английская Википедия/Панель перехода}} {{short description|File format}} {{other uses}} {{Infobox file format | name = Animated Portable Network Graphics | 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) | extensio...»)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)
Перейти к навигацииПерейти к поиску

Шаблон:Short description Шаблон:Other uses Шаблон:Infobox file format

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-bit images and 8-bit 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.

In a comparison made between GIF, APNG and lossless WebP, APNG had the lowest file size.[1]

History

Файл:Brain MRI apng 105px 100ms.png
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. 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);[2] 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.[3] 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)[4] while insisting on the use of the .png extension instead of .apng, leading to the format not being approved by the PNG Development Group.[5]

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

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

Файл:APNG Assembler Logo.svg
The logo of APNG Assembler, free software to create APNG images

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.[10] In 2010 Commercial Radio Broadcasters in Sydney began to include APNG animations in DAB+ digital radio broadcasts.Шаблон:Citation needed 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.Шаблон:Citation neededШаблон:Update inline

Mozilla's role in extending the PNG format to APNG echoes Netscape's much earlier role in popularizing animated GIFs.Шаблон:Citation needed

In 2016, Apple adopted the APNG format as the preferred format for animated stickers in iOS 10 iMessage apps.[11]

On March 15, 2017, APNG support was added to Chromium.[12]

File format

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

  • 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.[14]

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

Файл:Apng assembling.svg
Diagram illustrating a possible way to assemble an animated PNG from three individual PNG files

Compression and Optimization

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

Derived formats

Animated stickers for Signal are APNG with some restrictions.[18]

Support

Шаблон:See also

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

Шаблон:Notelist A server-side library exists that allows web browsers that support the canvas tag, but do not support APNG, to display APNGs.[54] Examples of such browsers include Microsoft Edge and Internet Explorer 9.

See also

References

Шаблон:Reflist

External links

Шаблон:Commons category

Шаблон:Graphics file formats Шаблон:Compression formats

  1. Шаблон:Cite web
  2. Шаблон:Cite web
  3. Шаблон:Cite web
  4. Шаблон:Cite web
  5. Шаблон:Cite web
  6. Шаблон:Cite web
  7. Шаблон:Cite web
  8. Шаблон:Cite web
  9. 9,0 9,1 Шаблон:Cite web
  10. Шаблон:Cite web
  11. Шаблон:Cite web
  12. Шаблон:Cite web
  13. Шаблон:Cite web
  14. Chunk Ordering Rules (PNG 1.2 spec)
  15. Шаблон:Cite web
  16. Шаблон:Cite web
  17. Шаблон:Cite web
  18. Шаблон:Cite web
  19. Шаблон:Cite web
  20. Шаблон:Cite web
  21. Шаблон:Cite web
  22. Шаблон:Cite web
  23. Шаблон:Cite web
  24. Шаблон:Cite web
  25. Шаблон:Cite web
  26. Шаблон:Cite web
  27. Шаблон:Cite web
  28. Шаблон:Cite web
  29. Шаблон:Cite web
  30. Шаблон:Cite web
  31. Шаблон:Cite web
  32. Шаблон:Cite web
  33. Шаблон:Cite web
  34. Шаблон:Cite web
  35. Шаблон:Cite web
  36. Шаблон:Cite web
  37. Шаблон:Cite web
  38. Шаблон:Cite web
  39. Шаблон:Cite web
  40. Шаблон:Cite web
  41. While XnView is available for several operating systems, only versions for Windows have been released since APNG support was added.
  42. Шаблон:Cite web
  43. Шаблон:Cite web
  44. Шаблон:Cite web
  45. Шаблон:Cite web
  46. Шаблон:Cite web
  47. 47,0 47,1 47,2 47,3 47,4 Шаблон:Cite web
  48. Шаблон:Cite web
  49. Шаблон:Cite news
  50. Шаблон:Cite web
  51. Шаблон:Cite web
  52. Шаблон:Cite web
  53. Шаблон:Cite web
  54. Шаблон:Cite web