PHP Imagick distortImage () function

PHP

Syntax:
bool Imagick::distortImage ($method, $arguments, $bestfit)
Parameter:This function takes three parameters as above and described below:
  • $method:This parameter stores the value of the image distortion method.
  • $arguments:this parameter stores the value of the arguments for the mange method as an array.
  • $method:this parameter stores the value of the method type which tries to resize the destination to match the malformed source
Return Value:This function returns True on success.Source image:
The following program illustrates the Imagick function::distortImage()in PHP:Program:  
/ * Imagick Object * / $imagick = new Imagick ( ' https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-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 title * / header ( "Content-Type: image / jpeg" ); echo $imagick ; ?>
Output: Link: http://php.net/manual/en/imagick.distortimage.php



Get Solution for free from DataCamp guru