png to slideshow (gif)

If I have 30 PNGs and i would like to make a slideshow or an animated gif what is the best way to do this? Can matplotlib do this?

···


— Get your facts first, then you can distort them as you please.–

There is an example showing how to create an MPEG-4 movie here:

http://matplotlib.sourceforge.net/examples/animation/movie_demo.html

Creating an animated gif would just be a matter of using the correct third-party tool that can combine a set of image frames.

Mike

···

________________________________________
From: Rita [rmorgan466@...287...]
Sent: Friday, March 18, 2011 7:49 AM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] png to slideshow (gif)

If I have 30 PNGs and i would like to make a slideshow or an animated gif what is the best way to do this? Can matplotlib do this?

--
--- Get your facts first, then you can distort them as you please.--

There is an example showing how to create an MPEG-4 movie here:

http://matplotlib.sourceforge.net/examples/animation/movie_demo.html

Creating an animated gif would just be a matter of using the correct third-party tool that can combine a set of image frames.

For example, gifsicle or ImageMagick.

Eric

···

On 03/18/2011 03:56 AM, Michael Droettboom wrote:

Mike

________________________________________
From: Rita [rmorgan466@...287...]
Sent: Friday, March 18, 2011 7:49 AM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] png to slideshow (gif)

If I have 30 PNGs and i would like to make a slideshow or an animated gif what is the best way to do this? Can matplotlib do this?

--
--- Get your facts first, then you can distort them as you please.--

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Dear matplotlib users,

The following very simple script generate an explosion of ram memory :

from numpy import *
import pylab as pl

while 1:
   data = random.random((512,512))
   pl.imshow(data)

How is it possible to loop over imshow, without having this problem ?

Thanks in advance,

yves

···

--
                                                  (o o)
--------------------------------------------oOO--(_)--OOo-------
   Yves Revaz
   Laboratory of Astrophysics EPFL
   Observatoire de Sauverny Tel : ++ 41 22 379 24 28
   51. Ch. des Maillettes Fax : ++ 41 22 379 22 05
   1290 Sauverny e-mail : Yves.Revaz@...2003...
   SWITZERLAND Web : http://www.lunix.ch/revaz/
----------------------------------------------------------------

Dear matplotlib users,

The following very simple script generate an explosion of ram memory :

from numpy import *
import pylab as pl

while 1:
    data = random.random((512,512))
    pl.imshow(data)

Try adding "pl.clf()" or "pl.cla().
Without that, each call to imshow is adding an image without deleting the previous one.

Eric

···

On 03/18/2011 11:15 AM, Yves Revaz wrote:

How is it possible to loop over imshow, without having this problem ?

Thanks in advance,

yves

I have used ffmpeg in the past with some success. It generates mpeg 4 video files, but maybe that's OK for you?

The only requirement is that your files are named on the format file_0000.png file_0001.png ...
See examples below.

Cheers
Paul.

···

On 18. mars 2011, at 12.49, Rita wrote:

If I have 30 PNGs and i would like to make a slideshow or an animated gif what is the best way to do this? Can matplotlib do this?

+++++++++++++++++++++++++

ffmpeg -qscale 5 -r 20 -b 9600 -i img%04d.png movie.mp4
ffmpeg -qscale 5 -r 20 -i img%04d.png movie.mp4

# The options are
#
# * -qscale 5 … define fixed video quantizer scale (VBR) where 1 is the best and 31 the worst. Since mpeg/jpeg has problems to compress line graphics it’s a good idea to set this variable close to 1. You get a big movie file, but otherwise the movie doesn’t look, well, that good.
# * -r … framerate
# * -b … video bitrate
# * -i input files, %04d says that we have four numbers in the filename where the number is filled with zeros left of it.
# * movie.mp4 is the filename, the extension says that it is a quicktime movie. You can also create a Macromedia Flash movie by using the .flv extension.
# Info from: http://tinyurl.com/dlwlnk
# Note that the images have to be numbered 1,2,3,... not (for example) 2, 4, 6... or 10, 20, 30...