ImageScript v4.0.0
    Preparing search index...

    InterfaceGIFAnimationEncodeOptions

    Options of Animation.encodeGIF and Animation.gifEncoder: those of GIFEncodeOptions for every frame, and the animation options

    interface GIFAnimationEncodeOptions {
        colors?: number;
        dither?: DitherMethod;
        ditherStrength?: number;
        metadata?: Metadata;
        optimize?: boolean;
    }

    Hierarchy (View Summary)

    Index
    colors?: number

    The maximum colors in each frame's palette (2-256, including transparency). Frames with fewer colors keep them exactly; otherwise ImageScript chooses representative colors

    256

    dither?: DitherMethod

    How to spread small color changes across nearby pixels to make gradients look smoother with few colors, see DitherMethod

    'floyd-steinberg'

    ditherStrength?: number

    How strongly to apply dithering: 0 disables it (like 'none'); 1 applies it fully

    0.85

    metadata?: Metadata

    Metadata to include, see Metadata

    optimize?: boolean

    Whether to store each frame as the area that changed since the frame before and merge identical frames, which usually makes files a lot smaller. The file shows the same animation either way, but only decodes to the same frames without it, which also encodes faster when little changes. The exception is GIF, which has no partial transparency: without optimize, a semi-transparent pixel becomes opaque or transparent in its own frame, with it the frames are composited first

    true