gd_topal.c

Summary
gd_topal.c
Functions
gdImageTrueColorToPaletteSetMethodSelects quantization method used for subsequent gdImageTrueColorToPalette calls.
gdImageTrueColorToPaletteSetQualityChooses quality range that subsequent call to gdImageTrueColorToPalette will aim for.
gdImageCreatePaletteFromTrueColor
gdImageTrueColorToPalette

Functions

gdImageTrueColorToPaletteSetMethod

int gdImageTrueColorToPaletteSetMethod (gdImagePtr im,
int method,
int speed)

Selects quantization method used for subsequent gdImageTrueColorToPalette calls.  See gdPaletteQuantizationMethod enum (e.g.  GD_QUANT_NEUQUANT, GD_QUANT_LIQ).  Speed is from 1 (highest quality) to 10 (fastest).  Speed 0 selects method-specific default (recommended).

Returns FALSE if the given method is invalid or not available.

gdImageTrueColorToPaletteSetQuality

void gdImageTrueColorToPaletteSetQuality (gdImagePtr im,
int min_quality,
int max_quality)

Chooses quality range that subsequent call to gdImageTrueColorToPalette will aim for.  Min and max quality is in range 1-100 (1 = ugly, 100 = perfect).  Max must be higher than min.  If palette cannot represent image with at least min_quality, then image will remain true-color.  If palette can represent image with quality better than max_quality, then lower number of colors will be used.  This function has effect only when GD_QUANT_LIQ method has been selected.

gdImageCreatePaletteFromTrueColor

gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im,
int dither,
int colorsWanted)

gdImageTrueColorToPalette

int gdImageTrueColorToPalette (gdImagePtr im,
int dither,
int colorsWanted)
int gdImageTrueColorToPaletteSetMethod (gdImagePtr im,
int method,
int speed)
Selects quantization method used for subsequent gdImageTrueColorToPalette calls.
void gdImageTrueColorToPaletteSetQuality (gdImagePtr im,
int min_quality,
int max_quality)
Chooses quality range that subsequent call to gdImageTrueColorToPalette will aim for.
gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im,
int dither,
int colorsWanted)
int gdImageTrueColorToPalette (gdImagePtr im,
int dither,
int colorsWanted)
Close