Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Image
- im = Image.open(<your image>)
- width, height = im.size # Get dimensions
- left = (width - new_width)/2
- top = (height - new_height)/2
- right = (width + new_width)/2
- bottom = (height + new_height)/2
- # Crop the center of the image
- im = im.crop((left, top, right, bottom))
- for more: https://cuty.io/BjT4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement