HEIC libraries
Nearly all open-source HEIC support goes through libheif, which parses the HEIF container and uses plugins for the codecs: libde265 to decode HEVC, x265 or kvazaar to encode. Whether a library can write HEIC depends on whether its libheif build includes an HEVC encoder; many prebuilt packages only decode, partly because of HEVC patent concerns.
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | libheif | yes | yes | the standard implementation; HEIC, AVIF, grids, depth, metadata |
| C/C++ | heicdec | yes | no | plain-C decoder with its own HEVC decoder, one file; AGPL |
| C# | LibHeifSharp | yes | yes | full libheif API for .NET; you supply the native libheif |
| C# | Magick.NET | yes | no | NuGet package includes libheif + libde265; HEIC is read-only |
| Go | libheif Go binding | yes | yes | cgo binding in the libheif repository, image.Decode support |
| Go | gen2brain/heic | yes | no | no cgo: WebAssembly decoder or system libheif |
| Python | pillow-heif | yes | yes | Pillow plugin, wheels include libheif with HEVC codecs |
| Python | pyvips | yes | yes | libvips binding; needs a system libvips with libheif |
| Ruby | ruby-vips | yes | yes | libvips binding |
| Rust | libheif-rs | yes | yes | safe libheif binding, image crate integration |
| PHP | Imagick | yes | yes | ImageMagick extension; depends on how ImageMagick was built |
No maintained open-source HEIC library exists for Java: use a libheif binary through a process call, or a commercial library.
By language#
- HEIC libraries for C/C++ Open-source C and C++ libraries for HEIC and HEIF images: libheif (read and write, with libde265 and x265) and heicdec (plain-C decoder). Code examples.
- HEIC libraries for C# Open-source .NET libraries to read and write HEIC images in C#: LibHeifSharp for the full libheif API, and Magick.NET for simple HEIC decoding.
- HEIC libraries for Go Open-source Go libraries to read and write HEIC images: the cgo libheif binding and the cgo-free gen2brain/heic decoder, with code examples.
- HEIC libraries for Python Open-source Python libraries to read and write HEIC images: pillow-heif for Pillow and pyvips for libvips, with code examples for converting HEIC to JPEG.
- HEIC libraries for Ruby Open-source Ruby libraries to read and write HEIC images: ruby-vips, the libvips binding, with examples for converting iPhone HEIC photos to JPEG.
- HEIC libraries for Rust Open-source Rust crates to read and write HEIC images: libheif-rs, safe bindings to libheif with image crate integration, plus notes on pure Rust decoders.
- HEIC libraries for PHP PHP libraries to read and write HEIC images: the Imagick extension with an ImageMagick built with libheif. Examples for converting iPhone photos to JPEG.