Replaces the current image with a subset of the original image.
- x
- Integer for horizontal coordinate of area to extract from the original image.
- y
- Integer for vertical coordinate of area to extract from the original image.
- width
- Integer for width of area to extract from the original image.
- height
- Integer for height of area to extract from the original image.
- padColor
- The color used for new pixels if necessary.
- allowPadding
- Flag indicating whether padding or an error occurs if the 'area' is outside of the image bounds. Default is False.
If the specified area extends beyond the boundaries of the original image, either pixels of the padColor (default is white) are added or an error occurs; depending upon the value of the 'allowPadding' parameter.