Batch convert to apng

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Batch convert to apng

Post by hellocatfood »

I'm using ImageMagick 6.9.7.4 on Ubuntu 17:10. I'm trying to convert a folder full of .gifs to .apng files. I'm doing this by running

Code: Select all

mogrify -format apng *.gif
. However, when I run this I get the following error:

Code: Select all

mogrify-im6.q16: unable to open image `apng:': No such file or directory @ error/blob.c/OpenBlob/2701.
mogrify-im6.q16: unrecognized image format `apng' @ error/mogrify.c/MogrifyImageCommand/4927.
If I choose any other format it works, and also if I use the convert command to convert one file. Is this an error with mogrify?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Batch convert to apng

Post by snibgo »

"mogrify -list format" will show you a list of formats that program can read/write. In my rather old versions of IM, "apng" isn't among them.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch convert to apng

Post by fmw42 »

I do not believe Imagemagick supports APNG only MNG
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Re: Batch convert to apng

Post by hellocatfood »

fmw42 wrote: 2018-01-22T11:44:46-07:00 I do not believe Imagemagick supports APNG only MNG
That's interesting! I converted all of the files to apng by running

Code: Select all

for file in *.gif ; do convert $file ${file%.*}.apng ; done
I ran identify on one of the files and it returned this:

Code: Select all

email.apng[0] GIF 55x60 55x60+0+0 8-bit sRGB 256c 24.6KB 0.010u 0:00.000
So it seems you're right!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch convert to apng

Post by fmw42 »

My guess is outputs the same as the input, since it shows GIF as the format. It does not recognize the desired apng and just outputs the input.
greenlands
Posts: 4
Joined: 2016-09-15T01:32:02-07:00
Authentication code: 1151

Re: Batch convert to apng

Post by greenlands »

If you would like ImageMagick to support APNG, you can add a message to this request:

https://www.imagemagick.org/discourse-s ... hp?t=20092
Post Reply