image: golang.org/x/image/tiff Index | Files | Directories

package tiff

import "golang.org/x/image/tiff"

Package tiff implements a TIFF image decoder and encoder.

The TIFF specification is at http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf

Index

Package Files

buffer.go compress.go consts.go reader.go writer.go

func Decode

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

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

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.

type CompressionType

type CompressionType int

CompressionType describes the type of compression used in Options.

const (
    Uncompressed CompressionType = iota
    Deflate
)

type FormatError

type FormatError string

A FormatError reports that the input is not a valid TIFF image.

func (FormatError) Error

func (e FormatError) Error() string

type InternalError

type InternalError string

An InternalError reports that an internal error was encountered.

func (InternalError) Error

func (e InternalError) Error() string

type Options

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
}

Options are the encoding parameters.

type UnsupportedError

type UnsupportedError string

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

func (UnsupportedError) Error

func (e UnsupportedError) Error() string

Directories

PathSynopsis
lzwPackage lzw implements the Lempel-Ziv-Welch compressed data format, described in T.

Package tiff imports 12 packages (graph) and is imported by 23 packages. Updated 6 days ago. Refresh now. Tools for package owners.