Documentation
¶
Overview ¶
Package webp implements a lossless WebP encoder using the VP8L bitstream format.
The encoder supports spatial prediction, subtract-green, color transform, color cache, and near-lossless quantization. Output is compatible with libwebp's dwebp decoder and golang.org/x/image/webp.
Reference: "WebP Lossless Bitstream Specification" https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_spec
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = errors.New("webp: not implemented")
ErrNotImplemented reports unsupported features or code paths.
Functions ¶
func ValidateOptions ¶
ValidateOptions validates encoder options for basic ranges.
Types ¶
type Options ¶
type Options struct {
// UsePredictor enables spatial prediction transform.
UsePredictor bool
// UseColorTransform enables the color transform.
UseColorTransform bool
// UseSubtractGreen enables the subtract-green transform.
UseSubtractGreen bool
// UseColorCache enables color cache with the given size (0 disables).
ColorCacheBits int
// Auto selects transforms based on image content.
Auto bool
// NearLossless sets near-lossless quality in [0..100], 0 disables.
NearLossless int
// HuffmanGroupBits controls meta Huffman groups (0 disables).
HuffmanGroupBits int
// LZ77Mode selects the match-finding strategy.
LZ77Mode LZ77Mode
// LZ77HashBits controls hash table size for LZ77ModeHash.
LZ77HashBits int
// LZ77Chain controls candidate count per hash bucket for LZ77ModeHash.
LZ77Chain int
}
Options defines encoder behavior.
func AutoOptions ¶
AutoOptions picks a simple, deterministic transform set based on image content.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns a sensible baseline for lossless encoding. Enables all three transforms (predictor, color, subtract-green) which works well on photographic content.
Source Files
¶
- auto_options.go
- bitwriter.go
- color_cache.go
- doc.go
- encode.go
- errors.go
- huffman.go
- lz77.go
- options.go
- options_validate.go
- pipeline.go
- pixels.go
- riff.go
- token_stream.go
- transform.go
- transform_encode.go
- transform_meta.go
- vp8l.go
- vp8l_encode_lit.go
- vp8l_encode_stream.go
- vp8l_encode_tokens.go
- vp8l_helpers.go
- vp8l_huffman_encode.go
- vp8l_stream.go
- vp8l_symbols.go