AVIF libraries for Go
The Go standard library and golang.org/x/image don’t read or write AVIF.
- gen2brain/avif runs libavif with dav1d and libaom compiled to WebAssembly, so it needs no cgo and no system libraries, but it uses a shared libavif when one is installed. It decodes and encodes still and animated AVIF and plugs into
image.Decode. Pick it for most programs.
Other options: govips (a cgo binding of libvips) reads and writes AVIF if you already use libvips, and gen2brain/gav1d is a newer pure Go port of dav1d with an AVIF decoder and a basic encoder.
- gen2brain/avif gen2brain/avif decodes and encodes AVIF in Go without cgo, using libavif compiled to WebAssembly. How to install it, convert PNG to AVIF, read size.