In order to resize and crop an image at the same time transform() function is used in wand. First crop operation is performed and then resize operation.
Syntax : wand.image.transform(crop=”, resize=”)
Parameter Input Type Description crop basestring A geometry string defining a subregion of the image to crop to resize basestring A geometry string defining the final size of the image
Let us take an image crop it in dimensions 200×200 and then rescale it to 400×400 pixels.
Example #2: Let us take an image crop 50 % of all four corners.
Example #3: Scale height of source image to 200px and preserve aspect ratio.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course