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

问题描述 投票:1回答:4

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

我的问题有什么解决方案吗?

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

请给我一些建议。

谢谢。

python image
4个回答
1
投票

使用Python Imaging Library (PIL)

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

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


3
投票

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

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

2
投票

你可以试试unofficial packages


0
投票

以下是我在python中调整图像大小的方法..假设我正在导入图片调用logo.png

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

“resample”会将其调整为“10,10”,请告诉我,如果我是最新的

© www.soinside.com 2019 - 2024. All rights reserved.