webp

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 13 Imported by: 15

README

webp

Status Go Reference

Go decoder for WebP Image File Format with support for animated WebP images.

Based on libwebp compiled to WASM and used with wazero runtime (CGo-free).

Documentation

Overview

Package webp implements an WEBP image decoder based on libwebp compiled to WASM.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMemRead  = errors.New("avif: mem read failed")
	ErrMemWrite = errors.New("avif: mem write failed")
	ErrDecode   = errors.New("avif: decode failed")
)

Errors .

Functions

func Decode

func Decode(r io.Reader) (image.Image, error)

Decode reads a AVIF image from r and returns it as an image.Image.

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

DecodeConfig returns the color model and dimensions of a AVIF image without decoding the entire image.

Types

type WEBP

type WEBP struct {
	// Decoded images.
	Image []*image.NRGBA
	// Delay times, one per frame, in milliseconds.
	Delay []int
}

WEBP represents the possibly multiple images stored in a WEBP file.

func DecodeAll

func DecodeAll(r io.Reader) (*WEBP, error)

DecodeAll reads a WebP image from r and returns the sequential frames and timing information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL