Actually, I screwed up. <div><br></div><div>See 60, 30? That's actually the range. The tuple to be checked will look like</div><div><br></div><div>(40, 25, 51)</div><div><br></div><div>So.... yeah. Sorry for the bad info.<br clear="all">

********************************<br><a href="http://www.vistro.net/" target="_blank">For a good time, go to Start:Run and type in format C</a> 
<br><br><div class="gmail_quote">On Mon, Apr 13, 2009 at 3:41 PM, Chris Rebert <span dir="ltr"><<a href="mailto:clp2@rebertia.com">clp2@rebertia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Mon, Apr 13, 2009 at 1:34 PM, Vistro <<a href="mailto:vistro@vistro.net">vistro@vistro.net</a>> wrote:<br>
> I have two problems, and I can't find anything about either of them.<br>
> The first is that PIL does not seem to have any way to search each and every<br>
> pixel for a value, like<br>
> for pixel in img:<br>
>     if pixel = ((60, 30), (58, 23), (87 57)):<br>
</div><snip><br>
<div class="im">> see if the pixel is in an acceptable color range. So, say, the 60 above can<br>
> be anywhere from 58-62, but the 30 needs to be between 28-40.<br>
> Is there any way to parse/deal with a value at a specific "slot" in a tuple?<br>
<br>
</div>Yes, use subscripting, just like with lists:<br>
<br>
the_tuple = (60, 30)#for example<br>
<br>
if not (58 <= the_tuple[0] <= 62) or not (28 <= the_tuple[1] <= 40):<br>
    #it's out of range, do something<br>
<br>
Cheers,<br>
Chris<br>
<font color="#888888">--<br>
I have a blog:<br>
<a href="http://blog.rebertia.com" target="_blank">http://blog.rebertia.com</a><br>
</font></blockquote></div><br></div>