animation from sequence of PNGs

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
navaide@ieee.org
Posts: 2
Joined: 2014-02-01T09:48:29-07:00
Authentication code: 6789

animation from sequence of PNGs

Post by navaide@ieee.org »

On a MacMini I used the command convert F_.png movie.gif and got the GIF I want but -- here's where my gross inexperience shows up -- I can't figure out how to get a Powerpoint (using VMware) nor OpenOffice presentation to accept it.
How can I either
* convert that GIF to automated GIF or AVI or something that old PPT or OO will accept
or * get something like what's shown at http://www.youtube.com/watch?v=gGvRZLFzjDA for OSX(SnowLeopard) ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: animation from sequence of PNGs

Post by snibgo »

Code: Select all

convert F_.png movie.gif
... will take one file (F_.png) and create one gif image. If you have many png files, called F_000.png, F_001.png etc, you can create an animated gif with:

Code: Select all

convert F_*.png movie.gif
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: animation from sequence of PNGs

Post by fmw42 »

to make it animate, you need to add -delay X before the input images and and -loop 0 before the output gif to tell it how many time to loop. Zero means do not stop looping.

Code: Select all

convert -delay 20 F_*.png -loop 0 movie.gif
see
http://www.imagemagick.org/Usage/anim_basics/
navaide@ieee.org
Posts: 2
Joined: 2014-02-01T09:48:29-07:00
Authentication code: 6789

Re: animation from sequence of PNGs

Post by navaide@ieee.org »

I had tried that command, and did again more recently, with mixed success. The problem isn't with ImageMagick but, between operating systems, PPT versions, plus GIF formats in general, there's a ton of incompatibilities. One item I underestimated at first was the need to preface the filenames; just using "F1.--- F2.--- etc, allows the sequence to get arbitrarily jumbled (I still
don't know how or why). Even with that straightened out, though, success is mixed. I use PPT (not the latest version) through VMware to Mac OSX(Snow Leopard) and, on Windows, the file isn't accepted at all. OpenOffice doesn't like it either, so I learned about ReelBean from another (archived) discussion and used that to convert to .MOV. Even that isn't accepted by Windows PPT but, fortunately, OpenOffice Impress will play it -- but only once. Slide Show goes still after that one cycle; the zero (indicating continuous replay) had no effect. I then made another copy which I put into ReelBean and clicked on the "repeat" which worked
-- for just that one run. After a "Save As" in that new location, I tried to insert that (modified-for-repeat) file into OO Impress.
It wouldn't take it. Also, attempting to reopen that modified-for-repeat file into ReelBean consistently failed.

Overall result: I can run one cycle in OpenOffice Impress. I can't do more than that.

Compatibility - WOW. There should be a more robust way to get PNG sequences into PPT without all this trouble. Whatever that way would be, it probably won't involve GIF formats. I appreciate the considerate responses.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: animation from sequence of PNGs

Post by snibgo »

I don't do GIF or presentations much but, just for fun, I put one of my GIFs into OpenOffice Impress, v4.0.1 (on Windows 8.1), and saved as a PPT. It works fine, continuously looping, both when viewing in design mode and as a slideshow.

I created the GIF with "convert -delay 20 %FRAMES_DIR%\itr_f_*.png itr.gif". I think the default for "-loop" is 0.
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: animation from sequence of PNGs

Post by fmw42 »

Have you tried

convert -delay 20 F_*.png -loop 0 miff:- | convert - animation.mov
or
convert -delay 20 F_*.png -loop 0 miff:- | convert - animation.avi

But most players will ignore the -loop 0 and just loop once, unless you choose the LOOP option in the player.

The order gets jumbled if you do not have leading zeros in your file names. Thus F_10.png would come before F_2.png

To get the right order, use

F_0001.png
F_0002.png
...
F_0010.png
etc
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: animation from sequence of PNGs

Post by glennrp »

snibgo wrote:. I think the default for "-loop" is 0.
The default image->iterations used in the GIF decoder is 1 in ImageMagick, which means "play once". If you are converting from another format, it is likely to default to 0 in the GIF encoder, which means "play forever".
Post Reply