Slashdot Mirror


Presenting APNG: Like MNG, Only Better

An anonymous reader writes "It's fair to say that most people love PNG images (or at least hate GIFs). However, the one advantage GIFs have over PNGs is that they can be animated. There is, of course, an animated version of PNG, MNG, but few programs can view these images (mainly because the MNG decoder is so large that the likes of Mozilla refuse to include it). But there may be an answer coming: Vladimir Vukicevic and Stuart 'Pavlov' Parmenter (of Mozilla fame) have put together a specification for APNG (Animated Portable Network Graphics)." (Read more below.)

"Unlike MNG, APNG is not a separate file format, but rather an extension to PNG. Thus, APNG images are just normal PNG images (with the .png extension) but can be animated. The system is fully backwards-compatable, so any program that can open a PNG image will be able to open an APNG image (though non-APNG viewers will only show the first frame). Vitally, the decoder just adds an extra few kilobytes onto a standard PNG decoder. APNG support is in the process of being checked into Mozilla. Hopefully, other programs will follow suit."

4 of 424 comments (clear)

  1. WIP by Mekabyte · · Score: 5, Informative

    Discussion can be found here: http://bugzilla.mozilla.org/show_bug.cgi?id=257263

  2. Re:Don't hate it by mgv · · Score: 5, Informative

    16,777,216 != infinity :-)

    Actually, there is no point getting an infinite number of colours because:

    1) Most displays cannot show that many colour
    2) Even with a display that does 16 777 216 colours, the human eye cannot distinguish between that many shades (particularly in the blue region) which is why 16 bit colour (which has 5 + 6 + 5 bits to divide amongst the red, green & blue) puts the extra information into the green (I think, could also be red, but its never the blue)

    3) Most RGB displays, while they have gradations finer than the eye can distinguish, cannot show the full spectrum in width (from 400nm to 700nm wavelengths). You can put as many bits as you want on to any consumer display, there are colours it simply cannot do.

    4) Humans vary in their ability to see colour, making alot of the finer gradations imprecise. 8% of males have altered colour vision - as do a small percentage of women and those bits are really wasted on them. On the other hand, if you have had cataract surgery, the implantable lens will let in low end ultraviolet (which your retina can see) that our natural lens does not allow through. Not that I'm suggesting that it is good to see into the UV range :)

    My 2c worth

    Michael

    --
    There is no cryptographic solution to the problem where the intended receiver and the attacker are the same entity.
  3. Re:Why wasn't animation included in the first plac by sppavlov · · Score: 5, Informative

    APNG files _are_ PNG files. We didn't create a whole new format (since that would be silly) so APNG files will still be .PNG files. The first frame in an APNG file looks to current PNG decoders to just be a regular PNG. The APNG spec specifies some additional chunks that if found tell an APNG aware decoder how to find the rest of the frames.

  4. Re:Header size by Anonymous Coward · · Score: 5, Informative
    You're exaggerating a little, I think.

    Experiment #1: 1x1 white pixel. Results: GIF 35 bytes; PNG 67 bytes.

    Experiment #2: typical Slashdot icon resized to 16x16. Results: GIF 282 bytes; PNG 277 bytes.

    I don't see the header size making a huge difference. What does make a moderate difference is that PNG is not bound to 256 colours. You can use a 16-colour palette, in which case pixels are packed in 4 bits each. You can use a 4-colour palette, in which case pixels are packed in 2 bits each. Pixels can be of many different depths between 1 bit and 48 bits. GIF does not have this flexibility.

    This is important because icons very rarely use more than 16 colours. PNG gives a win in these cases.