Hi, I'm using the Image module to resize PNG images from 300 to 100dpi for 
use in HTML pages, but I'm losing some vertical and horizontal lines in the 
images (usually images of x-y plots).

Here's what I do:
import Image
def imgResize(self,filename):
        img = Image.open(filename)
        dpi = img.info.get('dpi')
        if dpi and 295 < int(dpi[0]) < 305:
            wd = img.size[0]/3.0 #convert from 300dpi to 100dpi
            ht = img.size[1]/3.0
            newimg= img.resize((int(wd),int(ht)))
            newimg.save(filename)

imgResize('myimage.png')

Can someone point me to a better way so I don't lose the reference lines in 
the images?
thanks,
--Tim Arnold


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to