When you rotate an image, you're not modifying the image in place - the result is a new image, which unfortunately doesn't carry the format data from the original.
 
You can simply copy the data over yourself from the original, or supply the dpi setting to the TIFF module when saving (it's supported now).
 
Kevin.
----- Original Message -----
From: Tim Ake
Sent: Monday, June 27, 2005 11:31 PM
Subject: [Image-SIG] PIL 1.1.5 - Loss of resolution

Hi,
I am using PIL 1.1.5 with Python 2.4, and am seeing a loss of resolution when dealing with images. I open an image that is 200 dpi, do a rotate, and save the rotated image. What I'm seeing is that the rotated image is saved at the same size, but is at 100 dpi instead of 200 dpi. My code frament is as follows:
 
    # open the tif file image
    im = Image.open(strFile)
    # rotate the image 90 degrees CCW
    om = im.rotate(90)
    # save the image as a.tif
    om.save("a.tif", "TIFF")    #save the rotated file
 
I can't afford a loss of resolution - any thoughts on maintaining my original resolution?
 
Thanks!
 

Tim Ake
335 Old Hickory Rd.
Woodstock, GA 30188
mailto:[EMAIL PROTECTED]
http://www.timake.com
(770) 928-2433 (phone)
(404) 944-4890 (cell)
 soli deo gloria

 
 


_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig
_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to