Skip to content

Format and codec support matrix

Copy page

Before choosing input and output formats, establish one core fact: reads depend on the loaders compiled into libvips; writes depend on native exporters. Format support is a property of the runtime libvips build rather than the language binding alone.

Export capability of the reference binding (libvips 8.17.3 / govips v2.19.0)

Section titled “Export capability of the reference binding (libvips 8.17.3 / govips v2.19.0)”

govips ImageRef offers these Export* methods, representing libvips 8.17.3 native write support (checked against the v2.19.0 source):

Export format Method
JPEG ExportJpeg
PNG ExportPng
WebP ExportWebp
AVIF ExportAvif
HEIF ExportHeif
GIF ExportGIF
TIFF ExportTiff
JPEG 2000 ExportJp2k
JPEG XL ExportJxl
Other (ImageMagick) ExportMagick

Reading is dispatched by header signature via NewImageFromFile / LoadImageFromBuffer / LoadImageFromReader to the loaders compiled into libvips:

  • Native read scope = the set of loaders enabled when your runtime libvips was built (inspect with vips -l foreign).
  • Go standard-library fallback and built-in registration: govips v2.19.0 already registers Go’s GIF, JPEG, PNG, and golang.org/x/image/webp decoders inside the package. Application code does not need extra _ "image/png" side-effect imports merely to use govips; only application code that calls Go’s image.Decode directly must manage its own decoder registration (see unknown formats and missing codecs).
  • Animated and sub-format signatures: older binding releases had incomplete signature checks for some sub-formats such as animated AVIF; verify with the vips CLI first to separate binding detection from libvips loader support.
Format Read (reference) Write (reference) Notes
JPEG Supported ExportJpeg Lossy; EXIF and ICC
PNG Supported ExportPng Lossless; alpha
WebP Supported ExportWebp Lossy/lossless; animation and alpha
AVIF Supported ExportAvif Lossy/lossless; version-dependent animation signature detection
HEIF/HEIC Supported ExportHeif Depends on libheif build configuration
GIF Supported ExportGIF Palette format; quality boundary in gif-quality
TIFF Supported ExportTiff Multi-page support
JPEG XL Supported ExportJxl Depends on whether libvips was built with libjxl
JPEG 2000 Supported ExportJp2k Depends on whether libvips was built with OpenJPEG
PDF Read (pdfload) via magick/native No dedicated ExportPdf method
BMP Read-focused via ExportMagick May use Go fallback decoder when no native loader is present

This table is based on the reference environment (libvips 8.17.3); sharp 0.35.5’s bundled libvips 8.18.7 depends on its prebuilt configuration, while pyvips and the CLI share the system 8.17.3. Per-format comparisons across the other interfaces are marked comparison-pending.

  • Whether a format is available depends on the libvips build in your target host or container image, not on this handbook’s snapshot alone.
  • Do not assume another binding or distribution package enables the exact same codecs by default just because the reference environment supports an export.

This page is a version snapshot, reviewed 2026-10-12; format capability varies with the runtime libvips build.