Format and codec support matrix
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 |
Read support and Go fallback boundaries
Section titled “Read support and Go fallback boundaries”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/webpdecoders inside the package. Application code does not need extra_ "image/png"side-effect imports merely to use govips; only application code that calls Go’simage.Decodedirectly 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
vipsCLI first to separate binding detection from libvips loader support.
Quick matrix of common formats
Section titled “Quick matrix of common formats”| 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 |
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.
Related troubleshooting guides
Section titled “Related troubleshooting guides”- Animation / multi-page: loading all frames is covered in animation keeps one frame or becomes a tall image; GIF encoding parameters in why GIF Quality has no effect.
- Colour / ICC: CMYK resizing and dropped ICC profiles in colour shifts, missing ICC profiles, and CMYK distortion.
- Unknown formats and missing codecs: layered diagnosis in unknown formats and missing codecs.
When not applicable
Section titled “When not applicable”- 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.
Sources
Section titled “Sources”- govips v2.19.0 source (
image_export.go,image.go,foreign.go). - Handbook troubleshooting guides: missing-codec, animation-multi-page, gif-quality, colour-shift.
This page is a version snapshot, reviewed 2026-10-12; format capability varies with the runtime libvips build.