A GIF animated photo format encoder that inherits FrameEncoder.
Construction of the encoder class is not required. Refer to DeckAdapter.render for usage. The constructor accepts a FrameEncoderSettings
object.
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.
extension
- ".gif"
mimeType
- "image/gif"
options
- The object under the gif
namespace in the FrameEncoder settings, see above.
modules/core/src/encoders/video/gif-encoder.js
GifEncoder is a wrapper around the loaders.gl GIFBuilder, which is under MIT license.