我用谷歌搜索在python中调整图像大小。但我发现在python 3.2中没有任何帮助。
我的问题有什么解决方案吗?
我不需要任何复杂的图像处理,只需要在python 3.2上运行调整大小的函数。
请给我一些建议。
谢谢。
使用Python Imaging Library (PIL)。
out = im.resize((128, 128))
Pillow是PIL的一个分支,除了它更新并支持Python 3x。您应该考虑使用Pillow,因为它的界面与PIL非常相似。例如。 syntax for geometrical transformations [resizes]是相同的:
im = Image.open("foo.png")
out = im.resize((128, 128))
你可以试试unofficial packages。
以下是我在python中调整图像大小的方法..假设我正在导入图片调用logo.png
Img = PhotoImage(file =“logo.Png”)。resample(10,10)
“resample”会将其调整为“10,10”,请告诉我,如果我是最新的