I tried the .tostring again, seems to be working using != instead of is not... Thanks for that thread link, very helpful. <br><br>I'll look more into im.transform and see what I can come up with. I'm not sure I fully understand what it does, but I'm reading it as I'll remove the wanted section of im and trash the rest. I'm more-so looking for a way to maybe divide an image into quantrants for individual manipulation without having to split and rebuild the image.
<br><br>My goal with these two features is I'd like to create a way to compare an image for changes based on an area of the image, rather then the entire image. Lets use the quadrants for example (mental code).<br> <br>1,2
<br>3,4<br>^ this is how the quad appears on the image (upper left, upper right, etc...)<br><br>for space in quad:<br> if newpic[space].tostring() != oldpic[space].tostring():<br> oldpic[space] = newpic[space]
<br> else :<br> # Dont really care because this [space] isn't important.<br> <br> <br><br><div><span class="gmail_quote">On 11/8/06, <b class="gmail_sendername">Danny Yoo</b> <<a href="mailto:dyoo@hkn.eecs.berkeley.edu">
dyoo@hkn.eecs.berkeley.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>On Wed, 8 Nov 2006, Chris Hengge wrote:
<br><br>> I'm trying to figure out how to compare im1 to im2 and recognize the<br>> difference. I dont care what the difference is...<br>><br>> something like<br>><br>> if im1 is not im2:<br>> print "Not same"
<br><br>Do not use 'is' here. It is not doing any kind of equality testing at<br>all. We had a discussion about 'is' just a few days ago:<br><br> <a href="http://mail.python.org/pipermail/tutor/2006-November/050680.html">
http://mail.python.org/pipermail/tutor/2006-November/050680.html</a><br><br>According to:<br><br> <a href="http://www.pythonware.com/library/pil/handbook/image.htm">http://www.pythonware.com/library/pil/handbook/image.htm
</a><br><br>the im.getdata() function looks interesting.<br><br><br>> I've tried im.tostring() but that doesn't ever enter the loop either.<br><br>This should have worked. I'm not sure if you tried comparing<br>two strings using 'is' or not.
<br><br>> Second question is this:<br>> Is there a way to divide the screen so I only grab maybe the lower right<br>> 200x200 pixels or some such?<br>> Or possibly a way to seperate the image into a grid so I could just take the
<br>> grid I wanted?<br><br>im.transform() from the documentation link above looks relevant. Is that<br>what you're looking for?<br></blockquote></div><br>