func Decode(r io.Reader) (img image.Image, err error)
Decode reads a TIFF image from r and returns it as an image.Image. The type of Image returned depends on the contents of the TIFF.
func DecodeConfig(r io.Reader) (image.Config, error)
DecodeConfig returns the color model and dimensions of a TIFF image without decoding the entire image.
func Encode(w io.Writer, m image.Image, opt *Options) error
Encode writes the image m to w. opt determines the options used for encoding, such as the compression type. If opt is nil, an uncompressed image is written.
CompressionType describes the type of compression used in Options.
type CompressionType int
Constants for supported compression types.
const ( Uncompressed CompressionType = iota Deflate LZW CCITTGroup3 CCITTGroup4 )
A FormatError reports that the input is not a valid TIFF image.
type FormatError string
func (e FormatError) Error() string
Options are the encoding parameters.
type Options struct { // Compression is the type of compression used. Compression CompressionType // Predictor determines whether a differencing predictor is used; // if true, instead of each pixel's color, the color difference to the // preceding one is saved. This improves the compression for certain // types of images and compressors. For example, it works well for // photos with Deflate compression. Predictor bool }
An UnsupportedError reports that the input uses a valid but unimplemented feature.
type UnsupportedError string
func (e UnsupportedError) Error() string