
APNG support lands in WebKit - maxst
https://bugs.webkit.org/show_bug.cgi?id=17022
======
mmastrac
APNG is a funny, political beast. It basically evolved after Mozilla decided
to nuke MNG support to make Firefox slimmer and then needed to re-invent a
transparency-capable animation format for browser "throbbers". There were
calls to replace libpng with libmng which purported to support both PNG and
MNG at the same binary size, but those never panned out.

IIRC, individuals in the PNG group took the whole thing as a slight and then
refused to incorporate it into the official spec, leaving it as a bit of an
orphan. The Chrome guys never bothered implementing it and quietly worked on
WebP.

I suspect that part of the reason APNG never received widespread adoption was
bad blood from MNG never getting proper attention. While MNG was kind of a
crappy spec in retrospect, it was still way better than an animated GIF.

Unfortunately JNG was also a casualty in this whole war -- a format that could
have been both lossless and supported proper alpha transparency.

[https://bugzilla.mozilla.org/show_bug.cgi?id=195280](https://bugzilla.mozilla.org/show_bug.cgi?id=195280)

[https://bugzilla.mozilla.org/show_bug.cgi?id=18574](https://bugzilla.mozilla.org/show_bug.cgi?id=18574)

~~~
gpvos
As far as I remember, the main difference in point of view was that the PNG
guys (rightly so, IMO) saw animations as something different from a still
image, and wanted to keep that distinction, also in the face of MIME types,
file headers, file name extensions, etc., while lots of other (misguided)
people wanted animation as a feature in an image format, because they were
used to that from GIF.

There may have been some bad blood from MNG, but that was not the main point
as far as I understand. Although I must say that the links you provide are
interesting reading.

~~~
mmastrac
Here's the vote where the PNG group rejected APNG:

[https://web.archive.org/web/20080203042347/http://sourceforg...](https://web.archive.org/web/20080203042347/http://sourceforge.net/mailarchive/message.php?msg_name=3.0.6.32.20070420132821.012dd8e8%40mail.comcast.net)

And Vlad's message after the vote:

[http://osdir.com/ml/graphics.png.general/2007-04/msg00286.ht...](http://osdir.com/ml/graphics.png.general/2007-04/msg00286.html)

~~~
maxst
APNG support in WebKit is implemented as a thin layer on top on regular
vanilla libpng.

So all that stuff is not very relevant.

~~~
mmastrac
From a technical point of view it's all irrelevant, but I find APNG to be very
interesting from a historical point of view. It's both a technical and a
political compromise, and all things considered, not a bad standard.

------
TazeTSchnitzel
Two down (Gecko, WebKit), two to go (Trident, Blink).

I'd love to see more browsers have APNG. Alpha transparency in animation is
awesome.

It's not a lossy format like WebP, but PNG offers more sophisticated lossless
compression than GIF (after all, it was supposed to be a better GIF,
basically), so I wonder if APNG could produce more efficient compression for
video with a good encoder.

~~~
leni536
> It's not a lossy format like WebP

WebP can hold both lossless and lossy animations. AFAIK it can even have mixed
lossless and lossy frames in the same animation.

~~~
TazeTSchnitzel
Oh yes, I'm aware that it also supports lossless. I mentioned lossy because
that's what matters for the case of video specifically.

------
billyhoffman
Animated GIF's can be lossless optimized with GIFsicle. I went looking for
something similar for APNG and found apngopt.

[http://sourceforge.net/projects/apng/files/APNG_Optimizer/](http://sourceforge.net/projects/apng/files/APNG_Optimizer/)

Think of it as pngcrush for each animation frame. Also, it can leverage
Google's Zopfli implementation of DEFLATE, which produces much smaller output
than zlib's implementation. I haven't seen any other lossless optimization
tools using Zopfli, so that's pretty cool. (update: actually it looks like
recent versions of advpng can use Zopfli)

Also, some good comparisons of APNG vs. GIF vs. WebP animations are here:

[http://littlesvr.ca/apng/gif_apng_webp1.html](http://littlesvr.ca/apng/gif_apng_webp1.html)

------
MLR
Would've been great to see this happen five years, seems like it's largely
irrelevant now with the prevalence of HTML5 video compression for short clips.

~~~
coob
For photorealistic video yes, but APNG is much more suited than anything else
for animated graphics where SVG isn't a good fit.

~~~
espadrine
Do you have examples where APNG wins compression-wise relative to H.264?

~~~
maxst
JPEG usually wins over PNG compression-wise, but in some use cases it makes
sense to use PNG.

The same thing with animation/video.

------
maxst
Status: RESOLVED FIXED

It's implemented on top of vanilla libpng.

In practice, only WebKit-based browsers will get APNG, not Chromium-based
ones. That's not a big market share. But WebKit and Blink engines are still
pretty similar, so there's something to consider.

~~~
masklinn
> In practice, only WebKit-based browsers will get APNG, not Chromium-based
> ones. That's not a big market share.

Safari Mobile is a pretty big marketshare, if that ever trickles down to it.

~~~
maxst
Safari uses WebKit, except for WebKit image decoders.

The good news is, Apple implemented APNG support on their own:
[http://caniuse.com/apng](http://caniuse.com/apng)

So at this point there are 2 open source implementation, plus 1 closed source.

------
greggman
As APNG any good? My uninformed impression is it's kind of crap. Wishing
they'd all support BPG instead

[http://bellard.org/bpg/](http://bellard.org/bpg/)

~~~
TD-Linux
Unfortunately, BPG is heavily patent encumbered so no one can risk shipping it
right now.

------
cogburnd02
I can't wait for APNG support to become standard. Most of the GIF animations
on Wikimedia Commons seem like they'd be more efficiently encoded as PNGs; I
wonder what the size comparison (GIF vs. APNG) is like for some of the images
on there? e.g.

[http://commons.wikimedia.org/wiki/File:Color_coded_racetrack...](http://commons.wikimedia.org/wiki/File:Color_coded_racetrack_large_channel.gif)

~~~
witty_username
Many would be even more efficiently encoded in <choose your favorite video
format here>, I guess.

------
ChrisGranger
What are people using to create APNG animations? I have an older version of
Photoshop but it doesn't seem to support the format. I tried APNG Anime Maker,
but it's really rudimentary and doesn't optimize the image at all the way
ImageReady does with GIFs.

~~~
maxst
Try this:

[https://sourceforge.net/projects/apngasm/](https://sourceforge.net/projects/apngasm/)

------
Eric_WVGG
Oh goodness. With retina displays becoming commonplace, the need for a
modernized lossy + alpha standard like JPEG2000, JPEG XR or even WebP is
stronger than ever. I can't believe they're wasting resources on… better meme
cartoons…

