DefaultQuality is the default quality encoding parameter.
const DefaultQuality = 75
func Decode(r io.Reader) (image.Image, error)
Decode reads a JPEG image from r and returns it as an image.Image.
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(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.
A FormatError reports that the input is not a valid JPEG.
type FormatError string
func (e FormatError) Error() string
Options are the encoding parameters. Quality ranges from 1 to 100 inclusive, higher is better.
type Options struct { Quality int }
Deprecated: Reader is deprecated.
type Reader interface { io.ByteReader io.Reader }
An UnsupportedError reports that the input uses a valid but unimplemented JPEG feature.
type UnsupportedError string
func (e UnsupportedError) Error() string