PHP | Imagick distortImage() Function Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The Imagick::distortImage() function is an inbuilt function in PHP which is used to distorts an image using various distortion methods. Syntax: bool Imagick::distortImage( $method, $arguments, $bestfit ) Parameter: This function accepts three parameters as mentioned above and described below: $method: This parameter stores the value of the method of image distortion. $arguments: This parameter stores the value of the arguments for the distortion method as an array. $method: This parameter stores the value of type of method which attempt to resize destination to fit distorted source Return Value: This function returns True on success. Original Image: Below program illustrates the Imagick::distortImage() function in PHP: Program: php <?php /*Imagick Object*/ $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-17.png'); $points = array( 0, 0, 55, 25, 100, 0, 100, 50 ); $imagick->setimagebackgroundcolor("lightgreen"); $imagick->setImageVirtualPixelMethod(\Imagick::VIRTUALPIXELMETHOD_BACKGROUND); /* distortImage */ $imagick->distortImage(\Imagick::DISTORTION_AFFINE, $points, true); /*Image Header*/ header("Content-Type: image/jpeg"); echo $imagick; ?> Output: Reference: https://www.php.net/manual/en/imagick.distortimage.php Comment More infoAdvertise with us Next Article PHP | Imagick displayImages() Function S sarthak_ishu11 Follow Improve Article Tags : Misc Technical Scripter Web Technologies PHP Image-Processing PHP-function PHP-Imagick +3 More Practice Tags : Misc Similar Reads PHP | Imagick drawImage() Function The Imagick::drawImage() function is an inbuilt function in PHP which is used to render the ImagickDraw object on the Imagick object. It is used to draw the image on the Imagick instance. We set an image matrix, parameters and the borders of the drawn image with the help of ImagickDraw methods and t 2 min read PHP | Imagick displayImage() Function The Imagick::displayImage() function is an inbuilt function in PHP which is used to displays an image object. Syntax: bool Imagick::displayImage( $servername ) Parameters: This function accepts a single parameter $servername which is used to specify the server name. Return Value: This function retur 1 min read PHP | Imagick addImage() Function The Imagick::addImage() function is an inbuilt function in PHP which is used to adds new image to Imagick object image list. After the operation iterator position is moved at the end of the list. This function adds new image to Imagick object from the current position of the source object. The Imagi 1 min read PHP | Imagick displayImages() Function The Imagick::displayImages() function is an inbuilt function in PHP which is used to display an image or images sequence on an X server. Syntax: bool Imagick::displayImages( string $servername ) Parameters: This function accepts single parameter $servername which holds the X server name. Return Valu 1 min read PHP | Imagick decipherImage() Function The Imagick::decipherImage() function is an inbuilt function in PHP which is used to decipher an image which has been enciphered before. Syntax: bool Imagick::decipherImage( string $passphrase ) Parameters: This function accepts a single parameter $passphrase which holds the passphrase value or the 1 min read PHP | Imagick flipImage() Function The Imagick::flipImage() function is an inbuilt function in PHP which is used to create an image generated by a mirror-reversal of an original image across a vertical mirror. Syntax: bool Imagick::flipImage( void ) Parameters: This function does not accepts any parameters. Return Value: This functio 1 min read Like