tga: Index | Files

package tga

import ""

Package tga is a TARGA image format decoder/encoder.

Supports RLE and raw TARGA images with 8/15/16/24/32 bits per pixel, monochrome, truecolor and colormapped images. Correctly handles origins and attribute type in extensions area. Passes TGA 2.0 conformance suite (


Package Files

decode.go doc.go encode.go tga.go


var (
    ErrAlphaSize    = errors.New("tga: invalid alpha size")
    ErrFormat       = errors.New("tga: invalid format")
    ErrPaletteIndex = errors.New("tga: palette index out of range")

func Decode Uses

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

Decode decodes a TARGA image.

func DecodeConfig Uses

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

DecodeConfig decodes a header of TARGA image and returns its configuration.

func Encode Uses

func Encode(w io.Writer, m image.Image) (err error)

Encode encodes an image into TARGA format.

Package tga imports 8 packages (graph) and is imported by 3 packages. Updated 2017-02-16. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).