Method

VipsImagegifsave

Declaration [src]

int
vips_gifsave (
  VipsImage* in,
  const char* filename,
  ...
)

Description [src]

Optional arguments:

  • dither: %gdouble, quantisation dithering level
  • effort: %gint, quantisation CPU effort
  • bitdepth: %gint, number of bits per pixel
  • interframe_maxerror: %gdouble, maximum inter-frame error for transparency
  • reoptimise: %gboolean, reoptimise colour palettes
  • interlace: %gboolean, write an interlaced (progressive) GIF
  • interpalette_maxerror: %gdouble, maximum inter-palette error for palette reusage

Write to a file in GIF format.

Use dither to set the degree of Floyd-Steinberg dithering and effort to control the CPU effort (1 is the fastest, 10 is the slowest, 7 is the default).

Use bitdepth (from 1 to 8, default 8) to control the number of colours in the palette. The first entry in the palette is always reserved for transparency. For example, a bitdepth of 4 will allow the output to contain up to 15 colours.

Use interframe_maxerror to set the threshold below which pixels are considered equal. Pixels which don’t change from frame to frame can be made transparent, improving the compression rate. Default 0.

If reoptimise is TRUE, new palettes will be generated. Use interpalette_maxerror to set the threshold below which one of the previously generated palettes will be reused.

If interlace is TRUE, the GIF file will be interlaced (progressive GIF). These files may be better for display over a slow network conection, but need more memory to encode.

See also: vips_image_new_from_file().

This method is not directly available to language bindings.

Parameters

filename const char*
 

File to write to.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
...
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.