<div class="gmail_quote">On Mon, Jan 11, 2010 at 11:02 AM, Carnell, James E <span dir="ltr">&lt;<a href="mailto:jecarnell@saintfrancis.com">jecarnell@saintfrancis.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">







<div>

<br>

<p></p><div class="im"><font size="2" face="Courier New">&gt;</font>

<br><font size="2" face="Courier New">&gt; I&#39;m sure this is easy, but I am having a difficult time finding the </font>

<br><font size="2" face="Courier New">&gt; right search terms to find it on the Internet. Any help much </font>

<br><font size="2" face="Courier New">&gt; appreciated.</font>

<br><font size="2" face="Courier New">&gt;</font>

<br><font size="2" face="Courier New">&gt; 3 dimensional array(x,y,rgb) which is a PIL image into a numpy array </font>

<br><font size="2" face="Courier New">&gt; using &#39;asarray&#39; function.</font>

<br><font size="2" face="Courier New">&gt;</font>

<br><font size="2" face="Courier New">&gt; I want to subtract the Red Value in an array cell from a neighboring </font>

<br><font size="2" face="Courier New">&gt; Red Value cell.</font>

<br><font size="2" face="Courier New">&gt;</font>

<br><font size="2" face="Courier New">&gt; &gt;&gt;&gt; pictArray[39][4]                    #pixel at 39 4</font>

<br><font size="2" face="Courier New">&gt; array([150, 140, 120], dtype=unint8)</font>

<br><font size="2" face="Courier New">&gt;</font>

<br><font size="2" face="Courier New">&gt; &gt;&gt;&gt; pictArray[39][5]                    #pixel at 39 5</font>

<br><font size="2" face="Courier New">&gt; array([160, 150, 120], dtype=unint8)</font>

<br><font size="2" face="Courier New">&gt;</font>

<br><font size="2" face="Courier New">&gt; &gt;&gt;&gt; pictArray[39][4][0]                 #red pixel</font>

<br><font size="2" face="Courier New">&gt; 150</font>

<br><font size="2" face="Courier New">&gt;</font>

<br><font size="2" face="Courier New">&gt; &gt;&gt;&gt; pictArray[39][5[0]                  #neighboring red pixel</font>

<br><font size="2" face="Courier New">&gt; 160</font>

<br><font size="2" face="Courier New">&gt;</font>

<br></div><div class="im"><font size="2" face="Courier New">&gt; &gt;&gt;&gt; pictArray[39][4][0] - pictArray[39][5][0]</font>

<br></div><div class="im"><font size="2" face="Courier New">&gt; 246  # &lt;---------------  ???  vs -10</font>

<br><font size="2" face="Courier New">&gt;</font>

<br><font size="2" face="Courier New">&gt; How do I get the number -10? Does this have to do with the dtype?</font>

<br><font size="2" face="Courier New">&gt;</font>
</div><div class="im">

<p><font size="2" face="Courier New">It looks like you&#39;re re-typing from your terminal window into your Compose window... your life (and ours!) will be simpler if you just cut and paste. </font></p>

</div><p>        <font size="2" face="Courier New">- sorry I am at work and due to security reasons can&#39;t plug a thumb drive in for copying copde from my laptop. I have corrected the values above. </font></p>

<p>        <font size="2" face="Courier New">- pictArray[39][4][0] - pictArray[39][5][0] = 246  is where I am getting stuck</font>
</p>
<br>

</div>
<br></blockquote><div>Silly of me not to have noticed, but those are UNsigned 8-bit integers, which means values 0-255.  -10 wraps around to 246. <br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.fsrtechnologies.com">www.fsrtechnologies.com</a><br>