Documentation
¶
Overview ¶
Package images encodes images for a model to look at.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPixelFormat = errors.New("images: unsupported pixel format")
ErrPixelFormat is returned for raw pixels in a format Encode cannot read.
var ErrPixelSize = errors.New("images: pixels do not match the image size")
ErrPixelSize is returned for raw pixels that do not fill the size given.
Functions ¶
func Encode ¶
Encode encodes an image for a model to look at, and returns the encoded bytes and their MIME type.
An image whose format is a MIME type is already encoded and keeps its bytes. Raw pixels are encoded as a JPEG, without their alpha channel: format is the pixel format, "RGB", "RGBA", "RGBX" or "L" (8-bit grey), and empty is RGB.
Types ¶
This section is empty.