PHP | Imagick resampleImage() Function
Last Updated :
26 Aug, 2019
The Imagick::resampleImage() function is an inbuilt function in PHP which is used to resample the image to the desired resolution
Syntax:
bool Imagick::resampleImage( $x_resolution, $y_resolution, $filter,
$blur )
Parameters: This function accepts four parameters as mentioned above and described below:
- $x_resolution: This parameter stores the value of x resolution.
- $y_resolution: This parameter stores the value of y resolution.
- $filter: This parameter stores the value of the filter.
- $blur: This parameter stores the value of the blur level.
Return Value: This function returns True on success.
Original Image:
Below program illustrate Imagick::resampleImage() function in PHP:
Program:
<?php
$imagick = new \Imagick(
$imagick ->resampleImage(200, 200, \Imagick::FILTER_LANCZOS, 1);
header( "Content-Type: image/jpg" );
echo $imagick ->getImageBlob();
?>
|
Output:
Reference: http://php.net/manual/en/imagick.resampleimage.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...