Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

imagescale(3) [php man page]

IMAGESCALE(3)								 1							     IMAGESCALE(3)

imagescale - Scale an image using the given new width and height

SYNOPSIS
resource imagescale (resource $image, int $new_width, [int $new_height = -1], [int $mode = IMG_BILINEAR_FIXED]) DESCRIPTION
imagescale(3) scales an image using the given interpolation algorithm. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $new_width - The width to scale the image to. o $new_height - The height to scale the image to. If omitted or negative, the aspect ratio will be preserved. Caution You should always provide the height if using PHP 5.5.18 or earlier, or PHP 5.6.2 or earlier, as the aspect ratio calcula- tion was incorrect. o $mode - One of IMG_NEAREST_NEIGHBOUR, IMG_BILINEAR_FIXED, IMG_BICUBIC, IMG_BICUBIC_FIXED or anything else (will use two pass). RETURN VALUES
Return the scaled image resource on success or FALSE on failure. CHANGELOG
+-------------+---------------------------------------------------+ | Version | | | | | | | Description | | | | +-------------+---------------------------------------------------+ |5.5.19/5.6.3 | | | | | | | The calculation of the height if $new_height was | | | negative or omitted was fixed; prior to these | | | versions, the aspect ratio was not maintained | | | correctly. | | | | +-------------+---------------------------------------------------+ PHP Documentation Group IMAGESCALE(3)

Check Out this Related Man Page

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)
Man Page