代码:
结果:
from PIL import Image img = Image.open('D:\\image_for_test\\Spee.jpg') print("初始尺寸",img.size) print("默认缩放NEARESET",img.resize((128,128)).size) print("BILINEAR",img.resize((127,127),Image.BILINEAR).size) print("BICUBIC",img.resize((126,126),Image.BICUBIC).size) print("ANTIALIAS",img.resize((125,125),Image.ANTIALIAS).size)
结果: