IMAGESETINTERPOLATION(3) 1 IMAGESETINTERPOLATION(3)
imagesetinterpolation - Set the interpolation method
SYNOPSIS
bool imagesetinterpolation (resource $image, [int $method = IMG_BILINEAR_FIXED])
DESCRIPTION
Sets the interpolation method, setting an interpolation method affects the rendering of various functions in GD, such as the imagero-
tate(3) function.
PARAMETERS
o $
image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3).
o $method
- The interpolation method, which can be one of the following:
o IMG_BELL: Bell filter.
o IMG_BESSEL: Bessel filter.
o IMG_BICUBIC: Bicubic interpolation.
o IMG_BICUBIC_FIXED: Fixed point implementation of the bicubic interpolation.
o IMG_BILINEAR_FIXED: Fixed point implementation of the bilinear interpolation ( default (also on image creation)).
o IMG_BLACKMAN: Blackman window function.
o IMG_BOX: Box blur filter.
o IMG_BSPLINE: Spline interpolation.
o IMG_CATMULLROM: Cubic Hermite spline interpolation.
o IMG_GAUSSIAN: Gaussian function.
o IMG_GENERALIZED_CUBIC: Generalized cubic spline fractal interpolation.
o IMG_HERMITE: Hermite interpolation.
o IMG_HAMMING: Hamming filter.
o IMG_HANNING: Hanning filter.
o IMG_MITCHELL: Mitchell filter.
o IMG_POWER: Power interpolation.
o IMG_QUADRATIC: Inverse quadratic interpolation.
o IMG_SINC: Sinc function.
o IMG_NEAREST_NEIGHBOUR: Nearest neighbour interpolation.
o IMG_WEIGHTED4: Weighting filter.
o IMG_TRIANGLE: Triangle interpolation.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
imagesetinterpolation(3) example
<?php
// Load an image
$im = imagecreate(500, 500);
// By default interpolation is IMG_BILINEAR_FIXED, switch
// to use the 'Mitchell' filter:
imagesetinterpolation($im, IMG_MITCHELL);
// Continue to work with $im ...
?>
NOTES
Changing the interpolation method affects the following functions when rendering:
oimageaffine(3)
oimagerotate(3)
oimagescale(3)
PHP Documentation Group IMAGESETINTERPOLATION(3)