I am just starting to learn python. I am trying to make a program that opens a file, crops it and saves it. I wrote this:
from PIL import Image
image = Image.open('boi.jpg')
crop = image.crop((0,0,200,200))
crop.save("boicropped.jpg","JPEG")
This makes an empty file that i can not open:
i am sorry if it is an obvious mistake i am missing...
答案 0 :(得分:0)
Too low of rep to comment new to SO, I would remove your declaration of crop. Encapsulate your cropping of image, and follow with .save.