Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode reads a WebP image from the provided io.Reader and returns it as an image.Image.
This function is a wrapper around the underlying WebP decode package (golang.org/x/image/webp). It supports both lossy and lossless WebP formats, decoding the image accordingly.
Parameters:
r - The source io.Reader containing the WebP encoded image.
Returns:
The decoded image as image.Image or an error if the decoding fails.
func DecodeConfig ¶
DecodeConfig reads the image configuration from the provided io.Reader without fully decoding the image.
This function is a wrapper around the underlying WebP decode package (golang.org/x/image/webp) and provides access to the image's metadata, such as its dimensions and color model. It is useful for obtaining image information before performing a full decode.
Parameters:
r - The source io.Reader containing the WebP encoded image.
Returns:
An image.Config containing the image's dimensions and color model, or an error if the configuration cannot be retrieved
func Encode ¶
Encode writes the provided image.Image to the specified io.Writer in WebP VP8L format.
This function supports VP8L (lossless WebP) encoding and can handle color-indexed images when img is provided as image.Paletted.
Parameters:
w - The destination writer where the encoded WebP image will be written.
img - The input image to be encoded.
o - Pointer to Options containing encoding settings; currently unused but reserved
for future enhancements such as adjusting compression levels.
Returns:
An error if encoding fails or writing to the io.Writer encounters an issue.




