gifenc

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gifenc assembles a sequence of still frames into an animated GIF. Each frame is independently quantized to its own ≤256-color palette (median cut) and dithered, then written as one image block.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(frames []image.Image, opts Options) ([]byte, error)

Encode assembles frames into a single infinitely-looping animated GIF and returns its encoded bytes. Every frame must share the dimensions of frames[0] — the GIF canvas is fixed by the first image block, so a differently-sized frame cannot be represented without repositioning the whole animation.

Types

type Options

type Options struct {
	DelayMS   int // per-frame on-screen time in milliseconds
	NumColors int // per-frame palette size, clamped to [2,256]; 0 → 256
}

Options tunes the animated-GIF output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL