xgif

package
v0.0.0-...-e815181 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

xgif is a helper package to create GIF animations based on PNG images The resulting animations have the following properties: 1. All frames have the same size (max(pngs.width), max(pngs.height)) 2. All PNGs are centered in the given frame 3. The frame background is plain white Note that to convert from a PNG to a GIF compatible image (Bitmap), the PNG image must be quantized (colors are aggregated in median buckets) so that it has at most 255 colors. This is required because GIFs support only 256 colors and we must keep 1 slot for the white background.

Index

Constants

View Source
const INFINITE_LOOP = 0

Variables

View Source
var BG_COLOR = color.White

Functions

func AnimatePNGs

func AnimatePNGs(ms *xmain.State, pngs [][]byte, animIntervalMs int) ([]byte, error)

func Validate

func Validate(gifBytes []byte, nFrames int, intervalMS int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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