image = Image.open('demo_image.jpg') image.thumbnail((400, 400)) image.save('image_thumbnail.jpg') print(image.size) # Output: (400, 267)