Documentation ¶
Overview ¶
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 DecodeAll(r io.Reader) (*gif.GIF, 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.GIF) error
- type MedianCutQuantizer
- type Options
- type Quantizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode reads a GIF image from r and returns the first embedded image as an image.Image.
func DecodeAll ¶
DecodeAll reads a GIF image from r and returns the sequential frames and timing information.
func DecodeConfig ¶
DecodeConfig returns the global color model and dimensions of a GIF image without decoding the entire image.
Types ¶
type MedianCutQuantizer ¶
type MedianCutQuantizer struct {
NumColor int
}
MedianCutQuantizer constructs a palette with a maximum of NumColor colors by iteratively splitting clusters of color points mapped on a three-dimensional (RGB) Euclidian space. Once the number of clusters is within the specified bounds, the resulting color is computed by averaging those within each grouping.