PHP | Imagick adaptiveResizeImage() Function
The Imagick::adaptiveResizeImage() function is an inbuilt function in PHP which provides an adaptively resize image feature to the image. The intensity of an adaptive resize image depends on dramatically decreased at the edge of the image. This function is used to resize the image in according to web sites. It is useful when it shrinks the images slightly to a slightly smaller “web size” may not look good when a full-sized image is adaptively resized to a thumbnail.
Syntax:
bool Imagick::adaptiveResizeImage ( $columns, $rows, $bestfit )
Parameters: This function accepts three parameters as mentioned above and described below:
- $columns: This parameter is used to set the number of column in scaled image.
- $rows: This parameter is used to set the number of rows in scaled image.
- $bestfit: This parameter is used to check whether fit the image inside bounding box.
Return Value: This function returns TRUE on success.
Errors/Exceptions: This function throws ImagickException on error.
Below programs illustrate the Imagick::adaptiveResizeImage() function in PHP:
Original Image:

Program:
<?php // require_once('path/to/vendor/autoload.php'); header('Content-type: image/png'); $image = new Imagick( $image->adaptiveResizeImage(1024, 768); echo $image; ?> |
Output:

Reference: http://php.net/manual/en/imagick.adaptiveresizeimage.php
Recommended Posts:
- PHP | Imagick equalizeImage() Function
- PHP | Imagick getCopyright() Function
- PHP | Imagick extentImage() Function
- PHP | Imagick implodeImage() Function
- PHP | Imagick edgeImage() Function
- PHP | Imagick motionBlurImage() Function
- PHP | Imagick sharpenImage() Function
- PHP | Imagick enhanceImage() Function
- PHP | Imagick embossImage() Function
- PHP | Imagick adaptiveSharpenImage() Function
- PHP | Imagick convolveImage() Function
- PHP | Imagick pingImageBlob() Function
- PHP | Imagick paintTransparentImage() Function
- PHP | Imagick gammaImage() Function
- PHP | Imagick despeckleImage() 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.



