我正在使用Pillow在Python中调整图像大小。
image = Image.open("image_file.jpg")
print(image.format) # Prints JPEG
resized_image = image.resize([100,200],PIL.Image.ANTIALIAS)
print(resized_image.format) # Prints None!!
为什么resized_image.format
的值是None
?
如何在使用pillow进行调整大小时保留格式?
resized_image.format
不是“JPEG”,resized_image.save(“output.jpg”)
也可以正常工作。 - Kevin