Skip to content
Related Articles

Related Articles

PHP | Imagick distortImage() Function
  • Difficulty Level : Easy
  • Last Updated : 26 Aug, 2019

The Imagick::distortImage() function is an inbuilt function in PHP which is used to distorts an image using various distortion methods.


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:


/*Imagick Object*/
$imagick = new Imagick(
$points = array(
    0, 0,
    55, 25,
    100, 0,
    100, 50
/* distortImage */
$imagick->distortImage(\Imagick::DISTORTION_AFFINE, $points, true);
/*Image Header*/
header("Content-Type: image/jpeg");
echo $imagick;



My Personal Notes arrow_drop_up
Recommended Articles
Page :