The shave() function is an inbuilt function in the GraphicsMagick library which is used to shave the image pixels from the edges which specify the width of the region to be removed from both sides of the image and the height of the regions to be removed from top and bottom.
shave(width, height, percentage)
Parameters: This function accepts three parameters as mentioned above and described below:
- width: This parameter stores the value of the width by which the image is to be shaved.
- height: This parameter stores the value of the height by which the image is to be shaved.
- percentage: This is an optional boolean parameter which stores the percentage if set true otherwise pixels.
Return Value: This function returns Gmagick object with image added.