MathGroup Archive 2001

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

Search the Archive

Re: Mathematica generating gifs for avi's

  • To: mathgroup at
  • Subject: [mg29985] Re: Mathematica generating gifs for avi's
  • From: axc at
  • Date: Fri, 20 Jul 2001 03:28:48 -0400 (EDT)
  • Organization: Case Western Reserve University
  • References: <9ig70i$kfo$>
  • Sender: owner-wri-mathgroup at

yes i'd already written some function to do that, see:

including function to pad filenames with zeros. is there a built-in
way to do that by the way? unfortunately there's no option for
ToString[] that formats even integers with leading zeros

also, to be clear, creating separate files for each gif is not
necessary as Mathematica seems to be able to generate multiframe gifs no
problem. however, i still have to step outside Mathematica for the gif->avi
conversion (i'm using gif movie gear, which is shareware) which seems
ridiculous as the mac version of Mathematica can do this internally. will this
be remedied in a future version? $600 for Graphica is excessive.

i'm still looking for any tips or help in using Mathematica to write my 
dissertation. i used latex for my ms thesis but, i mean, c'mon, it's
2001, i should be able to use Mathematica entirely given that the print
version of Mathematica journal (new series) is made 99% w Mathematica
according to one of its editors (except for the table of contents) 

alan calvitti
axc 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] :=
>    Module[
>      {numzeros, padstring},
>      numzeros = len - StringLength[str];
>      If[
>        numzeros > 0,
>        padstring = StringJoin @@ Table["0", {numzeros}];
>        padstring <> str,
>        str
>      ]
>    ]
> graphicsList =
>   Block[
>     {i = 0},
>     Table[
>        {
>           i++; padZeros[ToString[i], 5],
>           Plot[Sin[2 \[Pi] f t],{t,0,1}, DisplayFunction -> Identity]
>        },
>        {f,0,20,4}
>     ]
>   ];
> Scan[
>   Export["frame" <> #[[1]] <> ".gif", #[[2]], "GIF"]&,
>   graphicsList
> ]
> -- 
> 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: [Q] Generalized Partitions
  • Next by Date: Equality constraints
  • Previous by thread: Re: Mathematica generating gifs for avi's
  • Next by thread: Mathematica and Scientific Workplace