Why GIF Quality has no effect
Changing GifExportParams.Quality in govips may have little effect on the resulting GIF. First check whether export uses libvips’ native gifsave; that path does not use a JPEG-style quality parameter.
Symptoms
Section titled “Symptoms”- Changing
GifExportParams.Qualitybarely changes the output GIF size. - Expecting JPEG-like quality semantics to control GIF quality, with no effect.
Root cause
Section titled “Root cause”libvips’ native gifsave has only parameters such as dither, effort, bitdepth, and interlace, and no quality. It has no JPEG-style “quality setting” concept — GIF is a palette format whose appearance is governed by a limited colour count.
GifExportParams.Quality exists because of an old path: on older libvips (below 8.12) gifsave falls back to magicksave (provided by ImageMagick), which is one of the few paths that honours quality. On native gifsave the field has no effect — so the maintainers only annotated it rather than removing it.
Use the parameters that work
Section titled “Use the parameters that work”To control GIF output, use the parameters native gifsave supports instead of quality. GifExportParams in govips actually exposes:
Effort: compression effort (affects file size and encoding time).Bitdepth: colour bit depth (affects colour count and size).Dither: dithering, which affects rendering quality but not size directly.
(The v2.19.0 source comments state it precisely: Quality is only used with vips < 8.12 via the magicksave fallback, and is ignored by native gifsave.)
Debug steps
Section titled “Debug steps”- Confirm whether your libvips uses native
gifsave(newer versions do). - Watch size change with
Effort/Bitdepthto verify the parameters take effect. - Do not treat
Qualityas a size control on the native gifsave path.
Affected versions and scope
Section titled “Affected versions and scope”- You expect
Qualityto work on your libvips version’s native gifsave — that is not a bug for native gifsave. - You expect lossy GIF quality to match JPEG — GIF is a palette format, so the semantics differ.
- This page was checked against the native
gifsavepath in govips v2.19.0 and libvips 8.17.3. Older ImageMagick fallback paths behave differently.
Sources
Section titled “Sources”- govips #359 — GIF Quality has no effect
- govips #501 — maintainers annotated it without removing the parameter
- govips v2.19.0 README
Different libvips releases can select different GIF save paths. Base conclusions on the operation registered in the target environment.