Interface EncoderOptions

interface EncoderOptions {
    delay?: number;
    dispose?: DisposalCode;
    framerate?: number;
    quality?: number;
    repeat?: number;
    transparent?: null | number;
}

Properties

delay?: number

The frame delay in milliseconds.

0
dispose?: DisposalCode

The GIF frame disposal code for the last added frame and any subsequent frames.

Defaults to one of the following values:

  • 0 : If transparent is set
  • 2 : Otherwise
framerate?: number

The frames per second, supersedes EncoderOptions.delay if set.

0
quality?: number

The quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification) between 1 and 30. Lower values (closer to 1) produce better colors but require significantly more resources and processing. 10 is the default value as it produces good color mapping at reasonable speeds.

Values greater than 20 do not yield significant improvements in speed.

repeat?: number

The number of times to repeat the GIF, between 0 and 65536, with two special cases:

  • -1: play once
  • 0: repeat indefinitely
-1

When set to a value different to -1, the GIF will use the Netscape 2.0 extension.

transparent?: null | number

The transparent color for the last added frame and any subsequent frames. Since all colors are subject to modification in the quantization process, the color in the final palette for each frame closest to the given color becomes the transparent color for that frame. May be set to null to indicate no transparent color.