Name
SaveAnim -- save animation to disk (V4.5)
Synopsis
SaveAnim(id, file$[, format, table])
Function
This function saves the specified animation to disk. The animation can currently be exported either as a GIF ANIM (limited to 256 colors) or as an AVI file using Motion JPEG compression. To save a GIF ANIM, use #ANMFMT_GIF as format; to save an AVI, use #ANMFMT_MJPEG.

The optional table argument allows you to configure further parameters:

Dither:
Set to True to enable dithering. This field is only handled when the destination format is palette-based. GIF ANIMs always use a color palette. Defaults to False which means no dithering.

Colors:
Specifies how many colors the animation shall use. Again, this is only handled for palette-based formats. Valid values are between 1 and 256. Defaults to 256.

Optimize:
Specifies whether or not Hollywood shall try to optimize the animation. Optimized saving is slower but usually leads to smaller animations. Defaults to True.

Transparency:
RGB color that shall be made transparent in the animation or #NOTRANSPARENCY for no transparency. This is only available for anim formats that supported transparency and is mutually exclusive with the UseAlpha table argument. Defaults to #NOTRANSPARENCY.

UseAlpha:
Specifies whether or not the resulting animation file should use alpha channel transparency. This is only available for anim formats that supported alpha channel transparency and is mutually exclusive with the Transparency table element. Defaults to False. (V5.1)

Quality:
Here you can specify a value between 0 and 100 indicating the compression quality for lossy compression formats. A value of 100 means best quality, 0 means worst quality. This is only available for anim formats that support lossy compression. Defaults to 90 which means pretty good quality.

FPS:
Video formats like AVI do not support an individual delay value for each frame but require a global value indicating how many frames per second shall be displayed. This field allows you to set the FPS. This is only handled for video file formats. Defaults to 25 frames per second.

Here is a table that shows an overview which table elements can be used with the different animation formats:

SaveAnim() can be used both with animations buffered completely in memory or with disk-based animations.

If you want to save an animation from individual frames (e.g. a series of brushes), you can do so by using BeginAnimStream(), WriteAnimFrame() and FinishAnimStream().

Inputs
id
animation which shall be saved
file$
destination file
format
optional: which anim format to use (defaults to #ANMFMT_GIF)
table
optional: further arguments for save operation; see above
Example
SaveAnim(1, "my_anim.gif", #ANMFMT_GIF, {Colors = 64, Dither = True})
The code above saves anim 1 as "my_anim.gif" in 64 colors with dithering enabled.

Show TOC