The
shear() function is an inbuilt function in the Pgmagick library 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.
Syntax:
shear(x, y)
Parameters: This function accepts two parameters as mentioned above and described below:
- x: This parameter is used to set degrees to x-shear of the image.
- y: This parameter is used to set degrees to y-shear of the image.
Return Value: This function returns the Pgmagick object with image added.
Input Image:
👁 Image
Output:
👁 Image
Example 2: