Table of Contents

Class GifWriterOptions

Namespace
Egami.Formats.Gif
Assembly
Egami.dll

Options for writing GIF.

public sealed class GifWriterOptions : WriterOptions
Inheritance
GifWriterOptions
Inherited Members

Examples

using FileStream output = File.Create("duck.gif");
photo.Save(output, GifFormat.Info, new GifWriterOptions
{
    Palette = new PaletteOptions { MaxColors = 128, Dither = DitherMode.Ordered }, // FloydSteinberg (default), Ordered or None
    PaletteScope = GifPaletteScope.PerFrame,   // Auto (default): one table when all frames fit, else one per frame
});

Properties

Default

Gets the default options.

public static GifWriterOptions Default { get; }

Property Value

GifWriterOptions

OptimizeFrames

Gets whether each frame after the first stores only the rectangle that changed, with unchanged pixels transparent where the palette has room. Defaults to true; false writes every frame whole.

public bool OptimizeFrames { get; init; }

Property Value

bool

Palette

Gets how palettes are built when the frames have more colors than fit. Defaults to Default.

public PaletteOptions Palette { get; init; }

Property Value

PaletteOptions

PaletteScope

Gets where an animation's palettes come from. Defaults to Auto.

public GifPaletteScope PaletteScope { get; init; }

Property Value

GifPaletteScope