This documentation is for the old version. Go to the latest Graphics Mill docs

GifEncoderOptions.BasisOptimizationFrameCount Property

Gets/sets the number of frames that will be stored before the global palette will be saved.

Namespace: Aurigma.GraphicsMill.Codecs
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public Property BasisOptimizationFrameCount As Integer
C#
public int BasisOptimizationFrameCount { get; set; }

Property Value

Number of frames to store. If this value is -1, there is no limit for the number of frames used to build a global palette for.

Remarks

If the optimization is enabled (the Optimized property is set to true), Graphics Mill for .NET will try to build a global palette which is common for all frames (other optimization activities are done as well, but they do not concern this property). Due a GIF format specification, no image data may be written before the global palette is saved. Therefore we cannot write a frame as soon as the AddFrame(IFrame) method is called. Instead of it we should store the frame in memory before the global palette will be generated and saved to the memory. Frames will be saved to the file only when the writer is closed.

Obviously, if you add too many frames, it will consume too much memory. To avoid this, use this value to specify a threshold for the number of frames to build a global palette for.

Another way to stop gathering statistics for the global palette is to set the LastFrame property to true on the frame we would like to stop. In this case the BasisOptimizationFrameCount will be disregarded.

If you add some frames after global palette is generated, and all entries of palettes of these frames are the same as in the global palette, Graphics Mill for .NET automatically uses the global palette. However if at least one color will not be contained in the global palette, this frame will be saved with a local palette.

See Also

Reference