Default parameter differences across interfaces
Many assume “same input + same intent = same output”, but the four interfaces expose different defaults for the same intent. The safest engineering assumption is that outputs are not byte-for-byte identical; check defaults before comparing across bindings.
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 why GIF Quality has no effect); Effort and 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. That is an explicit argument in the example code rather than govips’ default of 75.
Key differences
Section titled “Key differences”- Codec quality semantics: the sharpness/size trade-off differs per format;
Qualityis not a universal “sharpness” knob across formats. - Resize semantics: govips
Resizetakes a relative multiplier (and requires aKernel), unlikesharp.resize(w, h)target-dimension semantics. - Metadata default:
StripMetadatadefaults tofalsein govips, meaning metadata is kept and forwarded by default (see colour shifts, missing ICC profiles, and CMYK distortion). - Animation pages: only the first page (
n=1) is loaded by default; setNumPages=-1explicitly for animations (see animation keeps one frame or becomes a tall image).
Why byte-for-byte identity cannot be assumed
Section titled “Why byte-for-byte identity cannot be assumed”- sharp 0.35.5 bundles libvips 8.18.7, which differs from the system reference 8.17.3.
- pyvips and the CLI share the system libvips 8.17.3 with govips, but high-level wrapper defaults still need per-option confirmation.
- Cross-interface checks currently verify format, dimensions, and band metadata; pixel-level comparison remains
comparison-pending.
When not applicable
Section titled “When not applicable”- If you explicitly override all relevant encoding and interpolation parameters, default differences matter much less.
- Underlying defaults may also evolve between libvips releases; do not rely solely on this snapshot when upgrading.
Sources
Section titled “Sources”- govips v2.19.0 source (
NewWebpExportParams,NewJpegExportParams,NewGifExportParamsdefaults). - This handbook’s verification baseline (system libvips 8.17.3, sharp bundled 8.18.7).
This page records the reference govips defaults; cross-binding default comparisons for sharp, pyvips, and the CLI are marked
comparison-pending.