ImageMagick can't detect animated PNG

Created on 31 Aug 2015  路  36Comments  路  Source: ImageMagick/ImageMagick

Identify animated.png doesn't return data about animation. Used with JMagick, isAnimatedImage() return false for animated png.

upstream

Most helpful comment

Well. it's 2017 now, ten years later after Glenn said that. Could you reconsider this?

See https://github.com/onevcat/APNGKit:

Apple recently supported APNG in both desktop and mobile Safari. Microsoft Edge and Chrome are also considering adding APNG support since it is already officially added in WebKit core.

Most probably the .png was used to maintain backwards compatibility.

All 36 comments

No such thing as an animated PNG. Do you mean MNG? We did not write nor do we support JMagick. If you reproduce the problem from the command-line or from MagickCore, we will investigate further.

Animated PNG - https://en.wikipedia.org/wiki/APNG - it is extension to PNG, similarly as animated GIF is extension to 'normal' GIF.

I know, you are not author of JMagick, but it is just wrapper around your libs. It detects animated GIF correctly.

When asked if we support APNG, the PNG developer (Glenn who develops libpng) says: No. We detect and ignore the APNG chunks "acTL", "fcTL", and "fdAT". Why you ask? He further states "It was discussed at length on the PNG development list around 2007, voted upon, and disapproved.
PNG is a single image format, and supporting APNG would lead to the same confusion that
was introduced to GIF by making an animated variant. We would have approved it if the
proponents had not insisted upon using the .png extension instead of .apng."

Well. it's 2017 now, ten years later after Glenn said that. Could you reconsider this?

See https://github.com/onevcat/APNGKit:

Apple recently supported APNG in both desktop and mobile Safari. Microsoft Edge and Chrome are also considering adding APNG support since it is already officially added in WebKit core.

Most probably the .png was used to maintain backwards compatibility.

@urban-warrior, Any take take on what I said?

The PNG Development Group has not changed its stance regarding APNG. It's a little amusing that the original proponents of APNG have found a need to use ".apng" under some circumstances, in order to distinguish between APNG and PNG datastreams, and they've declared a MIME type for APNG. That approach would have been agreeable to the PNG group.

I hope this is added to ImageMagick soon as its now available in both Chrome / Firefox now. I am yet to find out whether apng supports playing certain frames once, and looping other sections.

On Sat, Sep 16, 2017 at 1:48 PM, QuantumRevenger notifications@github.com
wrote:

I hope this is added to ImageMagick soon as its now available in both
Chrome / Firefox now. I am yet to find out whether apng supports playing
certain frames once, and looping other sections.

APNG only supports looping the entire animation.

That's a shame but thanks for letting me know. If anyone knows of a format which can (if exists) would be appreciated.

Also, will APNG offer better sizes compared to gif? (Does Image Magick support it?)

The PNG proposed "mPNG" chunk supports arbitrary reuse of frames.
http://libpng.download/documents/proposals/history/png-mpng-proposal-20070411.txt
Proposed 10 years ago and pretty much forgotten.

APNG doesn't provide much better sizes than GIF -- maybe a little due to deflate compression versus LZW compression -- mainly it offers more colors and partial transparency.

Sorry if I ask, but what about naming the libpng supporting the APNG Specification "libapng" and forcing the output file extension to be ".apng" instead of ".png" whenever a PNG file containing the acTL, fcTL and fdAT chunks is created by ImageMagick? This way the PNG Development Group would have their view on PNG and APNG enforced, while from my tests a large majority of the current software that supports APNG files with ".png" extension also support APNG files with the ".apng" extension, including Goggle Chrome and Mozilla Firefox. The possible lack of backward compatibility wouldn't be a deal breaker, now that around 70% of the currently used browsers support APNG files. Not to say that the APNG Specification itself doesn't specify which file extension should be used for the output file.
I think everyone would win, and as I said before, many users of ImageMagick might not actually mind the forced ".apng" extension, some of them would probably welcome said behavior.

it was a bad call for the png group to not support apng, especially citing the gif (most popular animation format on the web) as a reason; support for apng in imagemagick, also, shouldn鈥檛 depend on the png group鈥檚 decision, especially now that the bulk of the work is done and a patch is available.

+1 for APNG, since in 2019 it is already available for >85 % of the web and most (relevant) browsers: https://caniuse.com/#feat=apng

+1. I have seen multiple websites and apps use this format and it seems superior to GIF in nearly every way. Forget about the PNG Group's decision; that was nearly 13 years ago and the web has drastically evolved since that time. apngasm/apngdis could be a good starting point for adding support: http://apngasm.sourceforge.net/

Yeah this is 2020. Time to support APNG.
Gifs used to be deprecated too, then we required them.
Now APNG is the new Gif. we need APNGs. They are better in every way possible.
Re-open the issue!

APNG is the new GIF

Do we need a new naive animated image format? Why can't the world move on to properly compressed videos? WEBM has caught on in a lot of places for autoplay+looping animations.

APNG is the new GIF

Do we _need_ a new naive animated image format? Why can't the world move on to properly compressed videos? WEBM has caught on in a lot of places for autoplay+looping animations.

APNG supports transparency compared WEBM, and by the way it's not new, and all browser supports it.

by the way it's not new

I was just quoting you, friend.

I believe that webm actually does support alpha transparency.

The two are not equivalent. WEBM is a video format which APNG is an animated image format similar to GIF.

I still want my APNG

I believe that webm actually _does_ support alpha transparency.

there's no browser support. meanwhile, every browser supports apng.

The two are not equivalent. WEBM is a video format which APNG is an animated image format similar to GIF.

That's kind of my point -- 99% of instances where animated images are used, videos would be more appropriate. APNGs, like GIFs, are a tremendously inefficient format, because they're bastardized stills.

GIFs are still widely used purely because the internet has gotten used to them. Let's not perpetuate the problem.

As far as browser support: every modern browser except Safari supports WEBMs. I would hardly call that "no browser support".

If you must support Safari or it must be an animated image format, then use WEBP -- it has support in all modern browsers (alpha and animation included) and it's much more modern (and standardized) than APNG. And ImageMagick supports it.

Okay so right now I need a gradiant, transparent animation.
Can't do this with gif as transparency is only 0 or 1, not 0 to 255.
Can't do this with webm as transparency is just not supported on browsers.
APNG do all of this.
Just accept it, stop being a technophobe, APNG is better.
If you care about 15% more data over your internet in 2020 for a simple image, maybe you just need a better connection.

Lets not argue on this forum. Be respectful. As it is, ImageMagick does not currently support either. At some point perhaps it will support both. If anyone is willing to code up either, you would likely get support for it. But the IM developers have limited time availability and are very busy otherwise with bug fixes and such.

@AuracleTech Have you tried WEBP? I think it could be really helpful for your use case. ImageMagick supports it.

No, I need APNG, WEBM won't work with what I'm doing right now.

As far as browser support: every modern browser except Safari supports WEBMs. I would hardly call that "no browser support".

no browser support for webm with transparency.

At some point perhaps it will support both.

people are here talking about it because the issue is closed and has been closed for years. there is no perhaps that will come to pass without noise.

If anyone is willing to code up either, you would likely get support for it.

mozilla patched the library imagemagick uses. the work has been done. imagemagick has not accepted that work.

We will not add support for APNG to the PNG coder until the APNG patch has been accepted by the libpng team. Once that has been added it should be possible for someone to add support for APNG.

No, I need APNG, WEBM won't work with what I'm doing right now.

WEBM and WEBP are different formats.

As far as browser support: every modern browser except Safari supports WEBMs. I would hardly call that "no browser support".

no browser support for webm with transparency.

Edge, Firefox, Chrome, and Opera all _supposedly_ support WEBM with transparency.

And all modern browsers definitely support WEBP transparency.

As far as browser support: every modern browser except Safari supports WEBMs. I would hardly call that "no browser support".

no browser support for webm with transparency.

Yeah. No browser support webm with transparency. So who cares if webm can support transparency.
APNG win.

Easy solution. ImageMagick is open-source. Create a pull-request for ImageMagick that supports APNG and/or WEBM. If its sufficiently cross-platform and robust, we will merge it in the ImageMagick distribution.

Easy solution. ImageMagick is open-source. Create a pull-request for ImageMagick that supports APNG and/or WEBM. If its sufficiently cross-platform and robust, we will merge it in the ImageMagick distribution.

Im a web dev I have no clue how images are even saved bit wise.

We pushed a patch to the master branch. You must specify APNG explicitly otherwise it assumes PNG:

convert apng:chompy.png chompy%03d.png

I have been testing using ffmpeg to determine arguments to put into the ImageMagick coding. Here are my examples using the beta with the patch (7.0.10.31 beta)

creates an APNG animation at 50 ticks delay and 10 loops:

im7beta magick lena.jpg mandril3.jpg monet2.jpg zelda1.jpg PNG:- | ffmpeg -framerate 100/50 -i - -plays 10 anim.apng

anim.apng.zip

creates a WEBM video at 50 ticks delay (no looping control for videos?):

im7beta magick lena.jpg mandril3.jpg monet2.jpg zelda1.jpg PNG:- | ffmpeg -framerate 100/50 -i - -c:v libvpx anim.webm

anim.webm.zip

Support for various browser versions can be found at:

https://caniuse.com/apng
https://caniuse.com/webm

Was this page helpful?
0 / 5 - 0 ratings