package png
Import Path
image/png (on golang.org and go.dev)
Dependency Relation
imports 10 packages, and imported by 0 packages
Involved Source Files
paeth.go
d-> reader.go
writer.go
Exported Type Names
type CompressionLevel int
const BestCompression
const BestSpeed
const DefaultCompression
const NoCompression
type Encoder (struct)
Encoder configures encoding PNG images.
BufferPool optionally specifies a buffer pool to get temporary
EncoderBuffers when encoding an image.
CompressionLevel CompressionLevel
Encode writes the Image m to w in PNG format.
type EncoderBuffer encoder (struct)
EncoderBuffer holds the buffers used for encoding PNG images.
func EncoderBufferPool.Get() *EncoderBuffer
func EncoderBufferPool.Put(*EncoderBuffer)
type EncoderBufferPool (interface)
EncoderBufferPool is an interface for getting and returning temporary
instances of the EncoderBuffer struct. This can be used to reuse buffers
when encoding multiple images.
( T) Get() *EncoderBuffer
( T) Put(*EncoderBuffer)
type FormatError string
A FormatError reports that the input is not a valid PNG.
( T) Error() string
T : error
type UnsupportedError string
An UnsupportedError reports that the input uses a valid but unimplemented PNG feature.
( T) Error() string
T : error
Exported Values
const BestCompression CompressionLevel = -3
const BestSpeed CompressionLevel = -2
func Decode(r io.Reader) (image.Image, error)
Decode reads a PNG image from r and returns it as an image.Image.
The type of Image returned depends on the PNG contents.
func DecodeConfig(r io.Reader) (image.Config, error)
DecodeConfig returns the color model and dimensions of a PNG image without
decoding the entire image.
const DefaultCompression CompressionLevel = 0
func Encode(w io.Writer, m image.Image) error
Encode writes the Image m to w in PNG format. Any Image may be
encoded, but images that are not image.NRGBA might be encoded lossily.
const NoCompression CompressionLevel = -1
![]() |
The pages are generated with Golds v0.1.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project and developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |