The Gmagick::shearimage() function is an inbuilt function in PHP which is used to slide one edge of an image along the X or Y axis to create a parallelogram. The X-direction shear slides an edge along the X-axis, while a Y direction shear slides an edge along the Y-axis. The shear angle is used to set shear of the image.
Gmagick Gmagick::shearimage( $color, $xShear, $yShear )
Parameters: This function accepts three parameters as mentioned above and described below:
- $color: This parameter is used to set the background color.
- $xShear: This parameter is used to set degrees to x-shear of the image.
- $yShear: This parameter is used to set degrees to y-shear of the image.
Return Value: This function returns the Gmagick object on success.
Errors/Exceptions: This function throws GmagickException on error.
Below programs illustrates the Gmagick::shearimage() function in PHP:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.