为什么Image.resize会裁剪imag

2024-09-28 23:20:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用Image.resizefrom PIL来调整图像大小。但是,当它调整图像的大小时,它会从图像的左侧裁剪大约5%。你知道怎么防止它切到图像吗?这是我的密码:

imgOut = Image.open('sample-out.jpg')
new_img = imgOut.resize((640,384), Image.ANTIALIAS)
new_img.save("small-out.jpg", "JPEG", optimize=True)

Tags: sample图像image密码imgnewpilopen