Default parameter differences across the four bindings
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.
govips reference defaults (v2.19.0)
Section titled “govips reference defaults (v2.19.0)”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.
Relation to this handbook’s recipes
Section titled “Relation to this handbook’s recipes”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.
Key differences
Section titled “Key differences”- Codec quality semantics: the sharpness/size trade-off differs per format; quality is not “sharpness”.
- Resize semantics: govips
Resizeis a relative multiplier (and requires a kernel), unlikesharp.resize(w,h)size semantics. - Metadata default:
StripMetadatadefaults 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=-1explicitly (see animation-multi-page).
Why identity cannot be assumed
Section titled “Why identity cannot be assumed”- 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.
When not applicable
Section titled “When not applicable”- 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.
Sources
Section titled “Sources”- govips v2.19.0 source (
NewWebpExportParams,NewJpegExportParams,NewGifExportParamsdefaults). - 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.