Decreasing brightness in the bottom half of a photo
<p>I have a questions thats stumping me right now. 
I have to decrease the brightness of the bottom half of a picture.
This is what I'm using so far. Its decreasing the brightness of the TOP half of my photo. How can I get it to decrease the bottom half? I know tat its somewhere in the third line I just can't figure it out. Any help would be greatly appreciated!</p>

<pre><code>def bottomHalf(image):

  pixels = getPixels(image)

  for index in range(0,len(pixels)/2):

    pixel=pixels[index]

    value1=getRed(pixel)

    setRed(pixel,value1*.8)

    value2=getGreen(pixel)

    setGreen(pixel,value2*.8)

    value3=getBlue(pixel)

    setBlue(pixel,value3*.8)

  show(image)
</code></pre>

<p>I believe you need to do half the pixels, <em>"but starting from half way through them rather than from the beginning"</em>, if I can put it like that!</p>

<p>So, replace this:</p>

<pre><code>for index in range(0,len(pixels)/2):
</code></pre>

<p>with this:</p>

<pre><code>for index in range(len(pixels)/2,len(pixels)):
</code></pre>

<p>Thanks to @MarkRansom for the correction.</p>

python image jes