Chevron DownOverview
Chevron Down@hubble.gl/core

GifEncoder

A GIF animated photo format encoder that inherits FrameEncoder.

Constructor

Construction of the encoder class is not required. Refer to DeckAdapter.render for usage. The constructor accepts a FrameEncoderSettings object.

FrameEncoderSettings

In addition to the top level FrameEncoder settings, these settings are available under the gif namespace.

  • width - The width in pixels the GIF is scaled to. Defaults to 720.

  • height - The height in pixels the GIF is scaled to. Defaults to 480.

  • numWorkers - The number of web workers concurrently encoding frames. Defaults to 4.

  • sampleInterval - Pixels to skip when creating the palette. Default is 10. Less is better, but slower.

Members

  • extension - ".gif"

  • mimeType - "image/gif"

  • options - The object under the gif namespace in the FrameEncoder settings, see above.

Source

modules/core/src/encoders/video/gif-encoder.js

Attributions

GifEncoder is a wrapper around the loaders.gl GIFBuilder, which is under MIT license.