Versions in this module Expand all Collapse all v1 v1.0.3 Nov 19, 2026 v1.0.2 Oct 16, 2026 v1.0.1 Oct 14, 2026 v1.0.0 Oct 12, 2026 Changes in this version + func Decode(r io.Reader) (image.Image, error) + func DecodeConfig(r io.Reader) (image.Config, error) + func DecodeConfigContext(ctx context.Context, r io.Reader, opts *DecodeOptions) (image.Config, error) + func DecodeContext(ctx context.Context, r io.Reader, opts *DecodeOptions) (image.Image, error) + func Encode(w io.Writer, m image.Image, opts *EncodeOptions) error + func EncodeContext(ctx context.Context, w io.Writer, m image.Image, opts *EncodeOptions) error + func EncodeRaster(ctx context.Context, w io.Writer, raster *Raster, opts *EncodeOptions) error + type ChannelInfo struct + Association uint16 + Index uint16 + Type ChannelType + type ChannelMapping struct + Column uint8 + Component uint16 + Type MappingType + type ChannelType uint16 + const ChannelColor + const ChannelOpacity + const ChannelPremultiplied + const ChannelUnspecified + type CodeBlockStyle uint8 + const CodeBlockBypass + const CodeBlockCausal + const CodeBlockPredictable + const CodeBlockReset + const CodeBlockSegmentation + const CodeBlockTerminate + type ColorSpace uint32 + const ColorGray + const ColorSRGB + const ColorSYCC + const ColorUnknown + type ColorTransform uint8 + const ColorTransformAuto + const ColorTransformIrreversible + const ColorTransformNone + const ColorTransformReversible + type Component struct + func (c *Component) Bounds() image.Rectangle + func (c *Component) Info() ComponentInfo + func (c *Component) ReadSamples(dst []int64, x, y int) error + func (c *Component) Sample(x, y int) int64 + func (c *Component) SetSample(x, y int, value int64) error + func (c *Component) WriteSamples(src []int64, x, y int) error + type ComponentInfo struct + Precision uint8 + Signed bool + XOffset float64 + XStep uint8 + YOffset float64 + YStep uint8 + type ComponentOptions struct + CodeBlockSize image.Point + CodeBlockStyle *CodeBlockStyle + DecompositionLevels *int + Index int + PrecinctSizes []image.Point + Quantization *Quantization + Wavelet *Wavelet + type DecodeOptions struct + ColorSpace ColorSpace + Limits Limits + MaxLayers int + Reduce int + Warning func(error) + Workers int + type Decoder struct + func NewDecoder(ctx context.Context, r io.Reader, opts *DecodeOptions) (*Decoder, error) + func (d *Decoder) Close() error + func (d *Decoder) Decode(ctx context.Context) (*Raster, error) + func (d *Decoder) DecodeBlocks(ctx context.Context, size image.Point, visit func(*Raster) error) error + func (d *Decoder) DecodeRegion(ctx context.Context, bounds image.Rectangle) (*Raster, error) + func (d *Decoder) DecodeSize(ctx context.Context, size image.Point) (*Raster, error) + func (d *Decoder) Info() Info + func (d *Decoder) Metadata(ctx context.Context) ([]MetadataBox, error) + func (d *Decoder) Reduction(size image.Point) (int, error) + type EncodeOptions struct + CodeBlockSize image.Point + CodeBlockStyle CodeBlockStyle + ColorTransform ColorTransform + Components []ComponentOptions + DecompositionLevels *int + EPH bool + Format Format + Layers []Layer + Limits Limits + Metadata []MetadataBox + PLM bool + PLT bool + PPM bool + PPT bool + PrecinctSizes []image.Point + Progression Progression + ProgressionChanges []ProgressionChange + Quantization *Quantization + ROI []image.Rectangle + SOP bool + TLM bool + TileOrigin *image.Point + TilePartPackets int + TileSize image.Point + Tiles []TileOptions + Wavelet Wavelet + type Format uint8 + const FormatJ2K + const FormatJP2 + type FormatError string + func (e FormatError) Error() string + type Info struct + Bounds image.Rectangle + CaptureResolution Resolution + Channels []ChannelInfo + ColorSpace ColorSpace + Components []ComponentInfo + DisplayResolution Resolution + ICCProfile []byte + Mapping []ChannelMapping + Palette []PaletteColumn + type Layer struct + BitsPerPixel float64 + type LimitError struct + Limit uint64 + Required uint64 + Resource string + func (e *LimitError) Error() string + type Limits struct + MaxInputBytes uint64 + MaxMemoryBytes uint64 + MaxSamples uint64 + type MappingType uint8 + const MappingDirect + const MappingPalette + type MetadataBox struct + Data []byte + Type string + type PaletteColumn struct + Precision uint8 + Signed bool + Values []int64 + type Progression uint8 + const CPRL + const LRCP + const PCRL + const RLCP + const RPCL + type ProgressionChange struct + ComponentEnd int + ComponentStart int + LayerEnd int + Order Progression + ResolutionEnd int + ResolutionStart int + type Quantization struct + GuardBits uint8 + Steps []QuantizationStep + Style QuantizationStyle + type QuantizationStep struct + Exponent uint8 + Mantissa uint16 + type QuantizationStyle uint8 + const QuantizationDerived + const QuantizationExpounded + const QuantizationNone + type Raster struct + func NewRaster(info Info, limits Limits) (*Raster, error) + func (r *Raster) Bounds() image.Rectangle + func (r *Raster) Clone(ctx context.Context, limits Limits) (*Raster, error) + func (r *Raster) Component(index int) *Component + func (r *Raster) Image(ctx context.Context, limits Limits) (image.Image, error) + func (r *Raster) Info() Info + type Resolution struct + X float64 + Y float64 + type TileOptions struct + CodeBlockSize image.Point + CodeBlockStyle *CodeBlockStyle + ColorTransform *ColorTransform + Components []ComponentOptions + DecompositionLevels *int + EPH *bool + Index int + Layers []Layer + PLT *bool + PPT *bool + PrecinctSizes []image.Point + Progression *Progression + ProgressionChanges []ProgressionChange + Quantization *Quantization + ROI []image.Rectangle + SOP *bool + TilePartPackets *int + Wavelet *Wavelet + type UnsupportedError string + func (e UnsupportedError) Error() string + type Wavelet uint8 + const Wavelet53 + const Wavelet97