package gif
import "image/gif"
Package gif implements a GIF image decoder and encoder.
The GIF specification is at http://www.w3.org/Graphics/GIF/spec-gif89a.txt.
Index ¶
- func Decode(r io.Reader) (image.Image, error)
- func DecodeConfig(r io.Reader) (image.Config, error)
- func Encode(w io.Writer, m image.Image, o *Options) error
- func EncodeAll(w io.Writer, g *GIF) error
- type GIF
- type Options
Functions ¶
func Decode ¶
Decode reads a GIF image from r and returns the first embedded image as an image.Image.
func DecodeConfig ¶
DecodeConfig returns the global color model and dimensions of a GIF image without decoding the entire image.
func Encode ¶
Encode writes the Image m to w in GIF format.
func EncodeAll ¶
EncodeAll writes the images in g to w in GIF format with the given loop count and delay between frames.
Types ¶
type GIF ¶
type GIF struct { Image []*image.Paletted // The successive images. Delay []int // The successive delay times, one per frame, in 100ths of a second. LoopCount int // The loop count. }
GIF represents the possibly multiple images stored in a GIF file.
func DecodeAll ¶
DecodeAll reads a GIF image from r and returns the sequential frames and timing information.
type Options ¶
type Options struct { // NumColors is the maximum number of colors used in the image. // It ranges from 1 to 256. NumColors int // Quantizer is used to produce a palette with size NumColors. // palette.Plan9 is used in place of a nil Quantizer. Quantizer draw.Quantizer // Drawer is used to convert the source image to the desired palette. // draw.FloydSteinberg is used in place of a nil Drawer. Drawer draw.Drawer }
Options are the encoding parameters.
Source Files ¶
- Version
- v1.3.0-rc.1
- Published
- Jun 2, 2014
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 14 seconds ago –
Tools for package owners.