A GIF frame.

Constructors

Properties

delay: number

The delay for this frame in units of 10ms (e.g., a value of 10 equals 100ms).

How the current frame should be disposed of when moving to the next one.

height: number

Height of the frame.

interlaced: boolean

True if the image is interlaced.

left: number

The horizontal offset of the frame relative to the left of the canvas.

needsUserInput: boolean

Indicates whether this frame requires user input to proceed.

top: number

The vertical offset of the frame relative to the top of the canvas.

transparent?: number

An optional index of a transparent color in the palette.

width: number

Width of the frame.

Accessors

  • get buffer(): Buffer

    The buffer of this frame.

    Returns Buffer

  • get palette(): null | Buffer<ArrayBufferLike>

    The frame's palette.

    Returns null | Buffer<ArrayBufferLike>

Methods

  • Parameters

    • val: Uint8Array

    Returns void

  • Sets the frame's palette.

    Parameters

    • Optionalval: null | Uint8Array<ArrayBufferLike>

    Returns void

  • Creates a frame from hex pixel data.

    • Speed needs to be in the range 1-30. Higher is faster, lower CPU usage but worse quality.
    • The size of buffer should match the expected size based on width, height.
    • The color output will be in Rgba.

    Parameters

    • width: number
    • height: number
    • buffer: string[]
    • Optionalspeed: null | number

    Returns Frame

  • Creates a frame from indexed pixel data.

    • The size of buffer should match the expected size based on width, height.

    Parameters

    • width: number
    • height: number
    • pixels: Uint8Array
    • Optionalpalette: null | Uint8Array<ArrayBufferLike>
    • Optionaltransparent: null | number

    Returns Frame

  • Creates a frame from RGB pixel data.

    • Speed needs to be in the range 1-30. Higher is faster, lower CPU usage but worse quality.
    • The size of buffer should match the expected size based on width, height.

    Parameters

    • width: number
    • height: number
    • buffer: Uint8Array
    • Optionalspeed: null | number

    Returns Frame

  • Creates a frame from RGBA pixel data.

    • Speed needs to be in the range 1-30. Higher is faster, lower CPU usage but worse quality.
    • The size of buffer should match the expected size based on width, height.

    Parameters

    • width: number
    • height: number
    • buffer: Uint8Array
    • Optionalspeed: null | number

    Returns Frame