faqts : Computers : Programming : Languages : Python : Common Problems : Images

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 4 people (75%) answered Yes
Recently 2 of 3 people (67%) answered Yes

Entry

How can one resize and or rotate jpegs?

Oct 30th, 2008 17:28
games games, Ian Bicking, Mixo Shiburi,


Use PIL: http://www.pythonware.com/products/pil/
After installing, do something like:
  import Image
  image = Image.open('pic.jpg')
  image.thumbnail( (100, 100) )
  # .thumbnail() won't change the aspect ratio, so (100, 100) is the
  # maximum size -- thumbnail works in-place.
  image = image.rotate(90)
  # 90 degrees in the clockwise direction -- rotate makes a copy.
http://www.r4r8.com/
http://www.r4r8.com/vb/
http://www.r4r8.com/hemo1
http://www.f01h.com/
http://www.f01h.com/vb
http://www.f01h.com/chat