SaveAnim(id, file$[, format, table])
id
to the file specified
by file$
in animation format specified by format
. This can either be
one of the following constants or an anim saver provided by a plugin:
#ANMFMT_GIF:
Colors
and Dither
tags (see below) to specify the number of
palette entries to allocate for the anim and whether or not dithering
shall be applied. When using #ANMFMT_GIF
with a palette anim, no
quantizing will be done. #ANMFMT_GIF
also supports palette anims
with a transparent pen. #ANMFMT_GIF
is the default format used
by SaveAnim()
.
#ANMFMT_MJPEG:
Quality
tag (see below) to control the level of compression
that should be used.
#ANMFMT_IFF:
Colors
and Dither
tags (see below) to specify the number of
palette entries to allocate for the anim and whether or not dithering
shall be applied. When using #ANMFMT_IFF
with a palette anim, no
quantizing will be done. #ANMFMT_IFF
also supports palette anims
with a transparent pen. (V9.0)
The optional table argument allows you to configure further parameters:
Dither:
True
to enable dithering. This field is only handled
when the destination format is palette-based and the source data
is RGB. GIF anims and IFF anims always use a color palette. Defaults to
False
which means no dithering.
Depth:
Colors:
Depth
tag. Instead of a bit depth,
you can pass how many colors the anim shall use here. Again,
this is only handled when the format is palette-based and the
source data is in RGB format. Valid values are between
1 and 256. Defaults to 256.
Optimize:
True
.
Quality:
FPS:
FillColor:
#NOCOLOR
which means that transparent pixels
will be left as they are. (V9.0)
Adapter:
UserTags:
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().
#ANMFMT_GIF
)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.