How to | Import and Export Animations

After creating or editing an animation in the Wolfram Language, you can export it for use in other programs. The Wolfram Language can import and export animations in several formats.

This page requires that JavaScript be enabled in your browser.
Learn how »

Selected examples from the video:

View the elements available for Import in a QuickTime file in the Wolfram Language documentation ExampleData directory:

Import the QuickTime file as an animation:

Use Length to see how many frames are in the animation:

Import a specific frame of the animation:

Use {"Frames",All} to import all of the frames in a list. You can do the same thing by using "GraphicsList" in place of {"Frames",All}:

Use ImageResize with Scaled to make each frame half its original size:

Use Sharpen on each of the frames:

Use ListAnimate to make a new animation from the processed frames:

Export the new animation to SWF, which is a format based on Flash. The % symbol specifies the most recent output, which in this case is the animation:

If you open the exported animation, you will see that it contains non-functional controls across the top. The animation is essentially a movie of a movie. To exclude these controls from the exported animation, simply export the list of frames directly to a file format supported by animations.

Here, the list of frames (stored in the symbol g3) is exported directly to SWF:

    

You can also import and export animations that you create in the Wolfram Language.

First, use Table to create 5 plots of where :

Use ListAnimate to create an animation from the list of plots:

As before, exporting the list of frames (in this case the plots) directly to a file format supported for use in animations creates an animation of the frames:

Once an animation is exported, you can also import it back into the Wolfram Language:

    

You can also export Manipulate objects as animations.

Use Manipulate with Plot3D to create an interactive 3D plot of where the value of varies from 0 to 4:

The next three steps are equivalent ways to export the entire Manipulate object, controls and all, to an animation.

Here the most recent output, which is the Manipulate object, is exported:

The Manipulate is also stored to m, so exporting m produces the same result:

You can also put the Manipulate expression inside the Export expression:

The animations "manipulate1.avi", "manipulate2.avi", and "manipulate3.avi" are identical. They also contain the framing and controls typical of Manipulate objects in the Wolfram Language.

To export animations that lack the framing or controls, you should generate a list of graphics representing a suitable number of steps used in the Manipulate and then export that list to a file format used for animations.

For example, use Table to create a list plot of and specify that should move from 0 to 4 in steps of 0.2:

Export the list of graphics to the file "manipulate4.avi":

You can create a longer, smoother animation by reducing the step size used in Table. For instance, reducing the step size from 0.2 to 0.1 will result in twice the number of plots in the list and subsequently, twice the number of frames when it is exported as an animation.

Correspondingly, the file size of the animation, as well as the time it takes the Wolfram Language to create both the plots and animation, will approximately double.

  • Importing and Exporting Data
  • Importing and Exporting Files
  • Exporting Graphics and Sounds
  • How to: Import and Export
  • How to: Import and Export File Elements
  • Import  Export  ListAnimate  Manipulate  Table

  • Importing & Exporting
  • "How to" Topics