Revision: 17581
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 10, 2009 03:10 by manatlan
Initial Code
def resize(im,percent):
""" retaille suivant un pourcentage 'percent' """
w,h = im.size
return im.resize(((percent*w)/100,(percent*h)/100))
def resize2(im,pixels):
""" retaille le coté le plus long en 'pixels'
(pour tenir dans une frame de pixels x pixels)
"""
(wx,wy) = im.size
rx=1.0*wx/pixels
ry=1.0*wy/pixels
if rx>ry:
rr=rx
else:
rr=ry
return im.resize((int(wx/rr), int(wy/rr)))
Initial URL
Initial Description
Initial Title
Resize Pil image
Initial Tags
image, python
Initial Language
Python