[Tutor] [tutor] Pil image related question -- resending message without attachments

Varsha Purohit varsha.purohit at gmail.com
Sun Jan 6 05:22:57 CET 2008


Hello All,
      I am actually working on a project which deals with image processing.
I just used pil function to resize the image into the dimensions i want. i
was able to resize the image but the clarity of the new image is not good.
Can anyone suggest which other functions i should use to improve the
clarity. I am attaching the code and sending the images in the attachment.
Can anyone suggest me how to do it ?

import Image

imageFile = "srk.jpg" #original small image

im1 = Image.open(imageFile)

width = 680
height = 420

im2 = im1.resize((width,height), Image.NEAREST)
im3 = im1.resize ((width,height), Image.BICUBIC)

#images get saved in c drive with jpg extensions
ext = ".jpg"
im2.save("C:/nearest" + ext)
im3.save("C:/Bicubic" + ext)

print "files are saved"



-- 
Varsha Purohit,
Graduate Student
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080105/eb78722a/attachment-0001.htm 


More information about the Tutor mailing list