你好,我想要将一批尺寸为(a,b,3)
的图片调整到更大的尺寸(c,d,3)
(c>a, d>b)
,并使用三次插值。但是当我第一次成功地调整大小后,重新打开调整大小后的图片时,发现图片仍然是旧的尺寸... 在我的尝试中,每张图片和每个尺寸都出现了这个问题... 请问有谁能指出我错过了什么吗?非常感谢!
以下是我的代码:
from PIL import Image
im = Image.open("img0.jpg").convert("RGB")
im # the original size
<PIL.Image.Image image mode=RGB size=600x337 at 0x102D83450>
im.resize((800,400),Image.BICUBIC)
<PIL.Image.Image image mode=RGB size=800x400 at 0x102D834D0> # thought I was doing it right
im.save("resized.jpg")
im=Image.open("resized.jpg").convert("RGB")
im
<PIL.Image.Image image mode=RGB size=600x337 at 0x102D83490> # and the actual size seems even smaller than before!