← back to roto on ba3a.dev

GifEncoder

Writes an animated GIF, byte for byte from its input. The global colour table is palette, after a transparent entry 0 when there is no background; opaque colours the frames hold beyond it follow in order of first appearance. Nothing is quantised or dithered. A pixel with alpha under 128 is transparent. Every frame is the full canvas and is cleared before the next. Delays are 10 ms units, rounded on cumulative time so that the total length stays exact.

More than 256 colour table entries, or a delay beyond the format's 16 bits, is refused with an IllegalArgumentException.

Constructors

Link copied to clipboard
constructor(palette: Palette)

Types

Link copied to clipboard
object Companion

What a GIF cannot show faithfully.

Functions

Link copied to clipboard
open override fun encode(frames: ExportFrames, options: AnimationOptions): ByteArray

The file holding frames, prepared as options ask.