<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Mark,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Did you get an answer or did you figure out your MemoryError issue concerning the python program you sent to Image-SIG on June 14, 2007?</DIV>
<DIV>&nbsp;</DIV>
<DIV>I seem to be having the same type of problem, except all I'm doing is applying a contrast enhancement to a .tiff or .jpg. I get this error: <STRONG>return im1._new(core.blend(im1.im, im2.im, alpha)) MemoryError</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV>My code looks like this:</DIV>
<DIV>import sys, os<BR>import glob, time<BR>import Image, ImageDraw, ImageFont<BR>import ImageEnhance</DIV>
<DIV>&nbsp;</DIV>
<DIV>os.chdir('D:/Ortho/jpg_outputs/cem/test/')</DIV>
<DIV>&nbsp;</DIV>
<DIV>#set image list by a glob search<BR>img_list = glob.glob('*.jpg')</DIV>
<DIV>&nbsp;</DIV>
<DIV># Start the loop of the images to be resized<BR>for img in img_list:<BR>&nbsp;&nbsp;&nbsp; name = img<BR>&nbsp;&nbsp;&nbsp; im = Image.open(img)<BR>&nbsp;&nbsp;&nbsp; enh = ImageEnhance.Contrast(im)<BR>&nbsp;&nbsp;&nbsp; enh.enhance(1.3).show("30% more contrast")<BR>&nbsp;&nbsp;&nbsp; <BR>#Save full resolution jpeg<BR>&nbsp;&nbsp;&nbsp; try:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; im.save('D:/ortho/jpg_outputs/cem/test/output/' + name[0:8] + ".jpg")<BR>&nbsp;&nbsp;&nbsp; except IOError:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "cannot export", name</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any Ideas?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>Dennis Kepler<BR>Remote Sensing Analyst<BR>MN DNR Forestry/Resource Assessment<BR>413 SE 13th Street, Grand Rapids MN 55744<BR>(218)327-4449 ext. 253, fax -4517 <BR>dennis.kepler@dnr.state.mn.us</BODY></HTML>