[Image-SIG] Memory Error

Dennis Kepler Dennis.Kepler at dnr.state.mn.us
Fri Feb 1 18:57:41 CET 2008

I seem to be having a memory problem, except all I'm doing is applying a contrast enhancement to a .tiff or .jpg. I get this error: return im1._new(core.blend(im1.im, im2.im, alpha)) MemoryError
The JPEG is about 45mb.
The TIFF is about 600mb.
My code looks like this:
import sys, os
import glob, time
import Image, ImageDraw, ImageFont
import ImageEnhance
#set image list by a glob search
img_list = glob.glob('*.jpg')
# Start the loop of the images to be resized
for img in img_list:
    name = img
    im = Image.open(img)
    enh = ImageEnhance.Contrast(im)
    enh.enhance(1.3).show("30% more contrast")
#Save full resolution jpeg
        im.save('D:/ortho/jpg_outputs/cem/test/output/' + name[0:8] + ".jpg")
    except IOError:
        print "cannot export", name
Any ideas?
Dennis Kepler
Remote Sensing Analyst
MN DNR Forestry/Resource Assessment
413 SE 13th Street, Grand Rapids MN 55744
(218)327-4449 ext. 253, fax -4517 
dennis.kepler at dnr.state.mn.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/image-sig/attachments/20080201/ce6c9686/attachment.htm 

More information about the Image-SIG mailing list