Python的PIL库中的resize方法

代码:
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)


结果:

猜你喜欢

转载自blog.csdn.net/minicattwo/article/details/80556963