Open PeterDaveHello opened 8 years ago
zopflipng currently will make APNG be a normal png
Side note: This is a side-effect of Mozilla overloading the PNG mimetype with APNG, and one of the reasons why the libpng folks explicitly told them not to do this. They did it anyway.
There are two aspects of fixing this: First, minimally keep the required chunks (this can be worked around by end-users today using the proper command line). Second, enhance the tool to apply Zopfli compression to the additional image data stored in those chunks.
Actually, it's a little more complicated than that, if the apng is using palette, ZopfliPNG will remove "unused" color if it's not used in the first frame. This will probably need some support for apng from lodepng.
zopflipng currently will make APNG be a normal png, which we should prevent to, if APNG can not be supported, maybe add some detections to bypass the compress of APNG can be workaround.
APNG spec: https://wiki.mozilla.org/APNG_Specification
APNG on wikipedia:
https://en.wikipedia.org/wiki/APNG
APNG demo: https://people.mozilla.org/~dolske/apng/demo.html
Note that APNG is not supported in most of the browsers: http://caniuse.com/#feat=apng