<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'I could use some help with my python program. Pretty PLease!!??' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'I could use some help with my python program. Pretty PLease!!??' posted on the 'Python' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 23:44:08 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 23:44:08 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>I could use some help with my python program. Pretty PLease!!??</title>
      <link>http://www.programmersheaven.com/mb/python/410225/410225/i-could-use-some-help-with-my-python-program-pretty-please/</link>
      <description>ok so this need to be a program that take to pictures ( that are the same  size ) and slowly fades the two into a newPic. this is what i have so far, but i am having major issues. I am totally new with programming and we are using JES.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;def main():
  showInformation( "Pick two pictures of the same size." )
  pic1= makePicture( pickAFile() )
  pic2= makePicture( pickAFile() )
  
  w=getWidth( pic1 )
  h=getHeight( pic1 )
  assert w == getWidth( pic2 )
  assert h == getHeight( pic2 )
  newPic= makeEmptyPicture( w,h )
  
  printNow( "working..." )
  for x in range (0,w) :
    for y in range (0,w) :
    
      totalRed= 0
      totalGreen= 0 
      totalBlue=0
      mixingLevels= x /(float(w-1)) # I totally mess things up here
      int( mixingLevels*
      for mixingLevels in range( 0, w-1 ):
        px= getPixel( pic1, 1-mixingLevels, y)
        totalRed= totalRed + getRed( px ) 
        totalGreen= totalGreen + getGreen( px )
        totalBlue= totalBlue + getBlue( px )
        
      avgRed= totalRed / (w - 1)
      avgGreen= totalGreen / (w - 1)
      avgBlue= totalBlue / (w - 1)
      
      #px1= getPixel( pic1, x, y )
      #px2= getPixel( pic2, x, y )
      pxNew= getPixel( newPic, x, y )
      setRed( pxNew, avgRed )
      setBlue( pxNew, avgBlue )
      setGreen( pxNew, avgGreen )
      
  printNow( "...done" )
  show( newPic )
      &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I think that i need to use a function called crossfade. here is a bit more info about the program, mixingLevel= x/ float(w-1) and int( mixingLevel*r2 + (1-mixingLevel) * r1)  where r1 and r2 and the red levels from both picture.&lt;br /&gt;
&lt;br /&gt;
please please please help!!!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/410225/410225/i-could-use-some-help-with-my-python-program-pretty-please/</guid>
      <pubDate>Wed, 02 Dec 2009 20:05:56 -0700</pubDate>
      <category>Python</category>
    </item>
  </channel>
</rss>
