13
$\begingroup$

I have a ".gif" figure exported from the following codes. 6 separated figures (frames) constitute a ".gif" figure. But the default time interval between each frame is less than 1 second. I hope to increase the time interval to 3 seconds, so the speed can be lower. Any one can help me? Thank you all in advance!

g1[a_, b_] := Graphics[{Red, Disk[{a, 0}, 1], Green, Disk[{1, 1}, 1], Blue, Disk[{b, 2}, 1]}];
f1 = Table[Show[g1[a, b] , PlotRange -> {{-2, 12}, {-2, 4}}  ], {a, 1, 8, 4}, {b, 0, 10, 5}];
f1 = Flatten[f1]
Export["f1.gif", f1]

enter image description here

enter image description here

$\endgroup$
10
  • 10
    $\begingroup$ Export["f1.gif", f1, "DisplayDurations" -> (# of seconds)] $\endgroup$
    – mfvonh
    Commented Jul 4, 2014 at 2:16
  • 1
    $\begingroup$ Also, "DisplayDurations" can be a list of time values, one for each individual frame. Ironically, this is a feature that GIF export offers whereas you can't do it easily for standard movie formats: see this question. $\endgroup$
    – Jens
    Commented Jul 4, 2014 at 3:22
  • 1
    $\begingroup$ This can be found in the documentation under GIF. $\endgroup$
    – user484
    Commented Jul 4, 2014 at 4:18
  • 1
    $\begingroup$ (continued) This is the primary google search result for "mathematica gif frame rate" so I think the first comment here should be converted to an answer. $\endgroup$
    – Jason B.
    Commented Oct 6, 2016 at 17:20
  • 2
    $\begingroup$ I've reopened. Anybody up for writing a canonical answer, then? $\endgroup$ Commented Oct 7, 2016 at 2:26

1 Answer 1

18
$\begingroup$

Although this is an old question, I'll post an answer:

The delay between frames (in seconds) can be controlled with the option "DisplayDurations". If it's a single number, then that's the delay between all the frames of the exported gif animation.

Another thing you can do is to provide a List as follows:

Export["f2.gif", f1, "DisplayDurations" -> {.1, 1}]

(* ==> "f2.gif" *)

gif

Here you see a fast-slow step combination because the list of durations {.1, 1} is repeated cyclically for successive frames.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.