HEIC libraries for Go
The Go standard library has no HEIC support. Two options:
- libheif Go binding (
github.com/strukturag/libheif/go/heif) lives in the libheif repository. It decodes and encodes HEIC and AVIF and registers withimage.Decode. Needs cgo and an installed libheif. - gen2brain/heic decodes HEIC without cgo: it uses a system libheif if present, otherwise a decoder compiled to WebAssembly. Read-only. Check the license of the embedded decoder before shipping it (see its page).
Pick the libheif binding when you need to write HEIC or already depend on cgo; pick gen2brain/heic for easy cross-compilation.
gen2brain/h265 (MIT) is a pure Go HEVC and HEIC decoder and encoder from the same author, with no cgo or WebAssembly.
- gen2brain/heic gen2brain/heic is a cgo-free HEIC decoder for Go using WebAssembly or a system libheif. Convert HEIC to JPEG or PNG, read image sequences and Exif metadata.
- libheif (Go) The libheif Go package reads and writes HEIC and AVIF images with cgo. Decode HEIC with image.Decode, convert HEIC to PNG or JPEG, encode HEIC.