如何在python 3.2中调整图像大小

时间:2011-09-15 12:20:43

标签: python image

我用Google搜索在python中调整图像大小。但我发现在python 3.2中没有任何帮助。

我的问题有解决办法吗?

我不需要任何复杂的图像处理,只需在python 3.2上运行调整大小功能。

请给我一些建议。

谢谢你。

4 个答案:

答案 0 :(得分:3)

Pillow是PIL的一个分支,除了它已更新并支持Python 3x。您应该考虑使用Pillow,因为它的界面与PIL非常相似。例如。 syntax for geometrical transformations [调整大小]是相同的:

im = Image.open("foo.png")
out = im.resize((128, 128))

答案 1 :(得分:2)

您可以尝试unofficial packages

答案 2 :(得分:1)

使用Python Imaging Library (PIL)

out = im.resize((128, 128))

参见示例“几何变换” http://effbot.org/imagingbook/introduction.htm

答案 3 :(得分:0)

以下是我在我的python中调整图像大小的方法..让我们说我导入图片调用logo.png

Img = PhotoImage(file =" logo.Png")。resample(10,10)

"重新采样"将它重新调整为" 10,10"请告诉我,我现在是不是