It's a animated PNG image. (Sadly the team developing the PNG standard refused it for their septate, non-PNG computable in favour of their pet version MNG.) A It is reverse comparable a PNG image and can easily be converted to and from septate PNG image into a APNG image.
Why I like it:
- It allows for future growth.
- It allows a image to be sent as a single file
- It allows supporting clients APIs to better handle animations. (In theory.)
- Because it builds on on the PNG's already modular format:
- Which means that a PNG maybe de-constructed into it's various modules with ease. So, instead of storing a PNG image as a single byte string it maybe stored in as few as two or three strings that maybe reused.
- Because PNG and APNG share the same modular construction and share many of the same modules (APNG has a few more for animation frame and timing information obviously.) converting between the two is as simple as just shuffling the modules around.
- If a full conversion to the animated PNG format is ever made it allows for many features and optimizations that a dedicated animation format allows for that a a series of static images does not.
- As a fall back, a APNG is displayed as a PNG by anything that can display PNGs, but doesn't recognise a APNG. (The addition frame and animation information is discarded and the first or second frame is displayed as a static image.)
While there are many "Ancillary" modules (or 'chunks' as PNG calls them) that I plan to include, at core reading converting between the two is relatively simple. The most basic PNG image contains five things:
- 8-bytes flagging the a image file as a PNG image.
- A header chunk containing basic image information.
- A palette containing information about what colours to use or fall back to.
- The image data
- And a "End of Image" marker.
- A animation control chunk, that tells how many frames a animation has, and how many times it should repeat.
- A frame control chunk that controls where and when a frame appears in the animation.
1. Taking the header of any frame in a current animation (It's sig and header chunk) as the APNG's header.
2. Copying the Palette information from any frame.
3. Add in animation control chunk using existing information.
4. Using the existing header or each frames header as a frame control chunk.
5. Adding in the image data from a of a frame.
6. Repeat 3 and 4 for each frame of the animation.
7. Add the "End of Image" chunk.
Converting from a APNG to a PNG is as simple as:
1. Using the frame control chunk of a APNG frame and the APNG's sig to construct a header.
2. Coping the Palette information from the APNG.
3. Copy the image data from a frame.
4. Add the "End of Image" chunk.
5. Repeat for each frame in a APNG.
With conversion and de-constructing the two as simple as it is, and with the the advantages a APNG offerers it seems silly of me (who is rewrite the code base anyway) to pass it up.