:art: Go AVIF library
go-avif implements AVIF (AV1 Still Image File Format) encoder for Go using libaom, the high quality AV1 codec.
Make sure libaom is installed. On typical Linux distro just run:
sudo apt-get install libaom-devsudo dnf install libaom-develTo use go-avif in your Go code:
import "github.com/Kagami/go-avif"To install go-avif in your $GOPATH:
go get github.com/Kagami/go-avifFor further details see GoDoc documentation.
…go-avif comes with handy CLI utility avif. It supports encoding of JPEG and
PNG files to AVIF:
# Compile and put avif binary to $GOPATH/bin
go get github.com/Kagami/go-avif/...
# Encode JPEG to AVIF with default settings
avif -e cat.jpg -o kitty.avif
# Encode PNG with slowest speed
avif -e dog.png -o doggy.avif --best -q 15
# Lossless encoding
avif -e pig.png -o piggy.avif --lossless
# Show help
avif -hStatic 64-bit builds for Windows, macOS and Linux are available at releases page. They include latest libaom from git at the moment of build.
To display resulting AVIF files take a look at software listed here. E.g. use avif.js web viewer.
go-avif is licensed under CC0.
No open issues yet, or sync has not completed.