PHP | Imagick distortImage() Function
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 /*Imagick Object*/$imagick = new Imagick( $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: http://php.net/manual/en/imagick.distortimage.php
Recommended Posts:
- PHP | Imagick getQuantumDepth() Function
- PHP | Imagick getQuantumRange() Function
- PHP | Imagick getPackageName() Function
- PHP | Imagick getImageScene() Function
- PHP | Imagick minifyImage() Function
- PHP | Imagick setImageRenderingIntent() Function
- PHP | Imagick setImageOpacity() Function
- PHP | Imagick getVersion() Function
- PHP | Imagick modulateImage() Function
- PHP | Imagick queryFonts() Function
- PHP | Imagick rotationalBlurImage() Function
- PHP | Imagick getImageSignature() Function
- PHP | Imagick getImageTicksPerSecond() Function
- PHP | Imagick getInterlaceScheme() Function
- PHP | Imagick annotateImage() 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.



