Versions in this module Expand all Collapse all v1 v1.2.0 Oct 17, 2026 v1.1.0 Oct 17, 2026 Changes in this version + const CompressionDefault + const CompressionNone + func Encode(img image.Image, w io.Writer, extra ...RawChunk) (int64, error) + func ISO_3309_CRC32(b []byte) uint32 type ChunkName + const EXIFChunk + const ICCPChunk + const ITXTChunk + const SRGBChunk + func NewITXTChunk(keyword, languageTag, translatedKeyword, text string, compress bool) (ChunkName, []byte, error) + type EXIF struct + Data []byte + func (e *EXIF) ChunkName() ChunkName + func (e *EXIF) Entries() ([]ExifEntry, error) + func (e *EXIF) Parse(chunk *chunk) error + type Encoder struct + ChunkSize int + CompressionLevel int + FilterStrategy FilterStrategy + Interlace bool + func (e *Encoder) Encode(img image.Image, w io.Writer, extra ...RawChunk) (int64, error) + type ExifEntry struct + Count uint32 + Tag uint16 + Type uint16 + Value []byte + type FilterStrategy uint8 + const FilterHeuristic + const FilterNone + type ICCP struct + CompressionMethod uint8 + Name string + Profile []byte + func (i *ICCP) ChunkName() ChunkName + func (i *ICCP) Parse(chunk *chunk) error type IEND + func (i *IEND) Parse(chunk *chunk) error type IHDR + func (c *IHDR) Validate() error + type ITXT struct + CompressionFlag uint8 + CompressionMethod uint8 + Data []byte + Keyword string + LanguageTag string + Text string + TranslatedKeyword string + func (i *ITXT) ChunkName() ChunkName + func (i *ITXT) Parse(chunk *chunk) error type Png + Channel int + EXIF *EXIF + Height int + ICCP *ICCP + ITXTs []*ITXT + SRGB *SRGB + Width int + func (p *Png) AddRawChunk(name ChunkName, data []byte) error + func (p *Png) DeleteRawChunk(name ChunkName) int + func (p *Png) IDATsToColor() (image.Image, error) + func (p *Png) MarshalBytes() ([]byte, error) + func (p *Png) RawChunkByName(name ChunkName) ([]byte, bool) + func (p *Png) RawChunks() []RawChunk + func (p *Png) ReplaceImage(img image.Image) error + func (p *Png) WriteTo(w io.Writer) (int64, error) + type RawChunk struct + CRC uint32 + Data []byte + Name ChunkName + type SRGB struct + RenderingIntent uint8 + func (s *SRGB) ChunkName() ChunkName + func (s *SRGB) Parse(chunk *chunk) error type TRNS + Blue uint16 + Data []byte + Gray uint16 + Green uint16 + PaletteAlphas []uint8 + Red uint16 v1.0.0 Sep 11, 2024 Changes in this version + var ISO_3309_CRC = []uint + type BKGD struct + Blue uint16 + Gray uint16 + Green uint16 + Palette uint8 + Red uint16 + func (b *BKGD) ChunkName() ChunkName + func (b *BKGD) Parse(chunk *chunk) error + type CHRM struct + BlueX uint32 + BlueY uint32 + GreenX uint32 + GreenY uint32 + RedX uint32 + RedY uint32 + WhiteX uint32 + WhiteY uint32 + func (c *CHRM) ChunkName() ChunkName + func (c *CHRM) Parse(chunk *chunk) error + type ChunkName string + const BKGDChunk + const CHRMChunk + const GAMAChunk + const HISTChunk + const IDATChunk + const IENDChunk + const IHDRChunk + const PHYSChunk + const PLTEChunk + const SBITChunk + const TEXTChunk + const TIMEChunk + const TRNSChunk + const ZTXTChunk + type ChunkParse interface + ChunkName func() ChunkName + Parse func(chunk *chunk) error + type GAMA struct + ImageGamma uint32 + func (g *GAMA) ChunkName() ChunkName + func (g *GAMA) Parse(chunk *chunk) error + type HIST struct + Elements []uint16 + func (h *HIST) ChunkName() ChunkName + func (h *HIST) Parse(chunk *chunk) error + type IDAT struct + ChunkTypeCode string + Data []byte + Length uint32 + func (i *IDAT) ChunkName() ChunkName + func (i *IDAT) Parse(chunk *chunk) error + type IEND struct + func (i *IEND) ChunkName() ChunkName + type IHDR struct + BitDepth uint8 + ColorType uint8 + CompressionMethod uint8 + FilterMethod uint8 + Height uint32 + InterlaceMethod uint8 + Width uint32 + func (c *IHDR) ChunkName() ChunkName + func (c *IHDR) Parse(chunk *chunk) error + type PHYS struct + UnitSpecifier uint8 + X uint32 + Y uint32 + func (p *PHYS) ChunkName() ChunkName + func (p *PHYS) Parse(chunk *chunk) error + type PLTE struct + Colors []*PLTEColor + func (p *PLTE) ChunkName() ChunkName + func (p *PLTE) Parse(chunk *chunk) error + type PLTEColor struct + Blue uint8 + Green uint8 + Red uint8 + type Png struct + BKGD *BKGD + CHRM *CHRM + GAMA *GAMA + HIST *HIST + IDATs []*IDAT + IEND *IEND + IHDR *IHDR + OtherChunk map[ChunkName][]ChunkParse + PHYS *PHYS + PLTE *PLTE + SBIT *SBIT + TEXTs []*TEXT + TIME *TIME + TRNS *TRNS + ZTXTs []*ZTXT + func ParsePng(r io.Reader) (*Png, error) + func (p *Png) GetOtherChunkByName(name ChunkName) ([]ChunkParse, error) + func (p *Png) ParseChunk(c ChunkParse, notSave ...bool) error + type SBIT struct + OrgData [4]byte + func (s *SBIT) ChunkName() ChunkName + func (s *SBIT) Parse(chunk *chunk) error + type TEXT struct + Keyword string + Separator string + Text string + func (t *TEXT) ChunkName() ChunkName + func (t *TEXT) Parse(chunk *chunk) error + type TIME struct + Day uint8 + Hour uint8 + Minute uint8 + Month uint8 + Second uint8 + Year uint16 + func (t *TIME) ChunkName() ChunkName + func (t *TIME) Parse(chunk *chunk) error + func (t *TIME) ToTime() time.Time + type TRNS struct + func (T *TRNS) ChunkName() ChunkName + func (T *TRNS) Parse(chunk *chunk) error + type ZTXT struct + CompressionMethod uint8 + Keyword string + Separator string + Text string + func (z *ZTXT) ChunkName() ChunkName + func (z *ZTXT) Parse(chunk *chunk) error