开发者

how to resize images in python 3.2

I googled about resizing images in python. but I found nothing helpful in python 3.2.

is there any solution to my problem?

I do not need any complicated image processing but just a resizing function run on python 3.2.

please give me some adv开发者_Python百科ises.

Thanks you.


Pillow is a fork of PIL, except it's updated and supports Python 3x. You should consider using Pillow, since its interface is very similar to PIL. E.g. the syntax for geometrical transformations [resizes] are the same:

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


Use the Python Imaging Library (PIL).

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

See example "Geometrical Transforms" http://effbot.org/imagingbook/introduction.htm


You can try the unofficial packages.


Here is how I resize images in my python .. Let's say I'm importing a picture call logo.png

from tkinter import PhotoImage

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

The "resample" will resize it to "10, 10" pls tell me if I'm correct

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜