MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Mathematica generating gifs for avi's

  • To: mathgroup at
  • Subject: [mg29796] Re: [mg29763] Re: [mg29713] Mathematica generating gifs for avi's
  • From: "P.J. Hinton" <paulh at>
  • Date: Tue, 10 Jul 2001 20:25:33 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

On Sun, 8 Jul 2001 axc at wrote:

> you're right it works. but listen to the steps i have to take to
> generate avi's for my presentation. nevermind generating names such as
> 'frame00001.gif' so that the shareware converter (in this case gif
> movie gear) loads them in the correct order - even so there are always
> several frames out of sequence and i have to permute them manually,
> for each .avi.

You could save yourself a lot of headaches by indexing your graphics as
you generate them and then using string manipulation functions to create
file names that are expected by the third-party program.

Suppose that we want to save out a large collection of graphics with a
Table[] operation.  For each Graphics object, we create an index and then
pad the index with an appropriate number of zeros.  Here, we pad the index
such that at leas four digits are always visible.

padZeros[str_String, len_Integer] :=
     {numzeros, padstring},
     numzeros = len - StringLength[str];
       numzeros > 0,
       padstring = StringJoin @@ Table["0", {numzeros}];
       padstring <> str,

graphicsList =
    {i = 0},
          i++; padZeros[ToString[i], 5],
          Plot[Sin[2 \[Pi] f t],{t,0,1}, DisplayFunction -> Identity]

  Export["frame" <> #[[1]] <> ".gif", #[[2]], "GIF"]&,

P.J. Hinton
User Interface Programmer                         paulh at
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.

  • Prev by Date: Re: Mathematica and Scientific Workplace
  • Next by Date: Re: Math Fonts in EPS-exported graphs
  • Previous by thread: Re: Mathematica generating gifs for avi's
  • Next by thread: Re: Mathematica generating gifs for avi's