Skip to content

Default parameter differences across the four bindings

Copy page

Many assume “same input + same intent = same output”, but the four bindings expose different defaults for the same intent. Assume there is no byte-for-byte identity; check defaults before comparing.

NewWebpExportParams() returns:

Field Default
Quality 75
Lossless false
NearLossless false
ReductionEffort 4
StripMetadata false
TargetSize 0 (disabled)

NewJpegExportParams() returns Quality 80, Interlace true.

NewGifExportParams() returns Quality 75, Effort 7, Bitdepth 8. Note that Quality has no effect under native gifsave (see gif-quality); Effort / Bitdepth are what affect output.

The recipe reference baseline explicitly sets WebP output quality to 82 (see each recipe’s reference metadata). That is explicit, not a default. A default of 75 differing from the recipe-shown 82 is normal.

  • Codec quality semantics: the sharpness/size trade-off differs per format; quality is not “sharpness”.
  • Resize semantics: govips Resize is a relative multiplier (and requires a kernel), unlike sharp.resize(w,h) size semantics.
  • Metadata default: StripMetadata defaults to false, i.e. metadata is kept and may be processed (see colour-shift).
  • Animation pages: only the first page is loaded by default; you must set NumPages=-1 explicitly (see animation-multi-page).
  • sharp bundles libvips 8.18.7, different from the reference 8.17.3.
  • pyvips / CLI share the reference system libvips 8.17.3, so defaults are closer but still need per-item confirmation.
  • The current comparison strategy is metadata-only; pixel comparison remains comparison-pending.
  • If you explicitly override all relevant parameters, default differences do not affect the outcome.
  • Defaults may also change between libvips versions; do not rely only on this page’s snapshot.
  • govips v2.19.0 source (NewWebpExportParams, NewJpegExportParams, NewGifExportParams defaults).
  • This handbook’s toolchain baseline (libvips 8.17.3, sharp bundled 8.18.7).
  • Reference output quality 82 from recipe metadata.

This page only records the reference binding’s defaults; the sharp / pyvips / CLI default rows are comparison-pending and not run-verified by the shared runner.