Go: image/jpeg Index | Files

package jpeg

import "image/jpeg"

Package jpeg implements a JPEG image decoder and encoder.

JPEG is defined in ITU-T T.81: http://www.w3.org/Graphics/JPEG/itu-t81.pdf.

Index

Package Files

fdct.go huffman.go idct.go reader.go scan.go writer.go

Constants

const DefaultQuality = 75

DefaultQuality is the default quality encoding parameter.

func Decode Uses

func Decode(r io.Reader) (image.Image, error)

Decode reads a JPEG image from r and returns it as an image.Image.

func DecodeConfig Uses

func DecodeConfig(r io.Reader) (image.Config, error)

DecodeConfig returns the color model and dimensions of a JPEG image without decoding the entire image.

func Encode Uses

func Encode(w io.Writer, m image.Image, o *Options) error

Encode writes the Image m to w in JPEG 4:2:0 baseline format with the given options. Default parameters are used if a nil *Options is passed.

type FormatError Uses

type FormatError string

A FormatError reports that the input is not a valid JPEG.

func (FormatError) Error Uses

func (e FormatError) Error() string

type Options Uses

type Options struct {
    Quality int
}

Options are the encoding parameters. Quality ranges from 1 to 100 inclusive, higher is better.

type Reader Uses

type Reader interface {
    io.ByteReader
    io.Reader
}

Deprecated: Reader is deprecated.

type UnsupportedError Uses

type UnsupportedError string

An UnsupportedError reports that the input uses a valid but unimplemented JPEG feature.

func (UnsupportedError) Error Uses

func (e UnsupportedError) Error() string

Package jpeg imports 6 packages (graph) and is imported by 1338 packages. Updated 2017-08-25. Refresh now. Tools for package owners.