16

Exporting to animated gif seems to have changed in Mathematica 8.0.1?

I normally make animated GIFs of a manipulate by simply writing:

v=Manipulate[....]

then Export["foo.gif",v];

But now it does not work. I just get one static image.

Here is an example:

v=Manipulate[
Text[t],
{{t,4,"start"},0,10,1,ControlType->Trigger,AnimationRate->1,AnimationRepetitions->10}
]

Now Export["foo.gif",v] just generate static image, as nothing was running.

But Export["foo.avi",v] works, and it does generate a running avi movie.

Also, there used to be animated GIF options I used before, but now there are not supported:

Export["foo.gif",v,ConversionOptions->{"AnimationDisplayTime"->0.5,"Loop"->True},ImageSize->{500,500}]

Export::convoptobs: ConversionOptions is obsolete. 

When I go to help, I do not see options for GIF there. How does one control animation delay and such?

I thought someone here might have an idea.

thanks --Nasser

Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
Nasser
  • 12,849
  • 6
  • 52
  • 104
  • I don't use version 8, but I am curious to know what you get if you use: `Export["foo.gif", {v}]` – Mr.Wizard May 24 '11 at 12:05
  • Same effect when I used {v}, no animated gif generated. – Nasser May 24 '11 at 12:22
  • A shame it wasn't that simple. I am afraid I cannot be of help. – Mr.Wizard May 24 '11 at 12:25
  • @Nasser What *Mathematica* version were you using that worked in the mentioned way? I tried `v=Manipulate[Text[t],{{t,4,"start"},0,10,1,ControlType->Trigger,AnimationRate->1,AnimationRepetitions->10}];Export["C:/foo.gif",v]` in the version 7.0.1 and it does generate a static image. – Alexey Popkov May 24 '11 at 13:54
  • 2
    Hello; I do not remember which version. But I do remember that I used to be able to export to animated gif a variable which I had set equal to the Maniupulate command. I could be may be wrong, but it does work with SWF and AVI? As for the options (for the Export to gif part) I do know for sure these used to work before, and now they no longer work. Either way, the question still, how would one export a Manipulate to animated gif file? Using Animate[] as was suggested instead of Manipulate did not work well for my case (UI changed a little when I did that). Thanks --Nasser – Nasser May 24 '11 at 15:20

2 Answers2

22

You can export a Table to an animated GIF.

v = Table[Panel[Text[t]], {t, 0, 10, 1}];
Export["anim.gif", v, "DisplayDurations" -> 0.5]

If you absolutely want the animation to look like a Manipulate, you could do something like so.

v = Table[Manipulate[Text[t], 
    {{t, Mod[k, 10], "start"}, 0, 10, 1, ControlType -> Trigger}],
  {k, 4, 14}];
Export["Manip.gif", v, "DisplayDurations" -> 0.5]
Mark McClure
  • 4,862
  • 21
  • 34
  • Thank you Mark! That did it. I wanted to vote your answer up, but it forum won't let me. I used your trick to finally animate a small Manipulate I did for school HW. If you like to see the animation, here it is http://12000.org/my_notes/mma_demos/pendulum_flywheel/index.htm I used latex to load it, scaled it down a little. Thanks again ! I like this forum much more than the other Math group, as there is no long delay here and one can finally talk Mathematica at well. --Nasser – Nasser May 24 '11 at 20:22
  • @Nasser - Glad to help! And I'm glad you like this forum. It's certainly different from mathgroup. I'm sure they both have their strengts, but I definitely like the turn around here. Concerning the upvote, you need to earn a bit of reputation before you can do so. I don't think it's too much. – Mark McClure May 25 '11 at 01:57
4

You can use v = Animate[ Text[t], {{t, 4, "start"}, 0, 10, 1, ControlType -> Trigger, AnimationRate -> 1, AnimationRepetitions -> 10}]

FreshApple
  • 592
  • 3
  • 14