PHP | Imagick resampleImage() Function
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:

Program:
<?php // Create new Imagick object $imagick = new \Imagick( // Use resampleImage function to resize image $imagick->resampleImage(200, 200, \Imagick::FILTER_LANCZOS, 1); // Image Header header("Content-Type: image/jpg"); // Display the output image echo $imagick->getImageBlob(); ?> |
chevron_right
filter_none
Output:

Reference: http://php.net/manual/en/imagick.resampleimage.php
Recommended Posts:
- PHP | Gmagick resampleimage() Function
- PHP | Imagick setImageMatte() Function
- PHP | Imagick appendImages() Function
- PHP | Imagick blueShiftImage() Function
- PHP | Imagick getImageLength() Function
- PHP | Imagick autoLevelImage() Function
- PHP | imagick getImageDispose() Function
- PHP | Imagick deskewImage() Function
- PHP | Imagick clutImage() Function
- PHP | Imagick queryFontMetrics() Function
- PHP | Imagick getImageChannelDepth() Function
- PHP | Imagick frameImage() Function
- PHP | Imagick getImageRenderingIntent() Function
- PHP | Imagick getImageMimeType() Function
- PHP | Imagick getImageMatte() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



