title: BlendIMG and ChromaKey() jes, explaining these functions and why my programs won't work
body: <p>Whenever I try to run a program in JES such as this for example,
             whenever I place anything inside the parenthesis, the program won't work?! what am I doing wrong!
  when I try to run the program and I type in image(pict), it just says error, name not found globally. 
  def image(pict):</p>
  
  <p>also what is wrong with this code I have made below, they won't run, also can you explain each part of my code in detail, as I know what to write but I'm having trouble understanding what to do.</p>
  
  <p>Also how do I write a function using a while statement, that say uses addLine() to add a route for multiple routes on a map, from using input?</p>
  
  <pre><code>def startEnvironemnt(pict):
    a = pickAFile()
    pict = makePicture(a)
    sourceH = getHeight(pict)
    sourceW = getWidth(pict)
    canvas = makeEmptyPicture(sourceW, sourceH)
    show(canvas)
    show(pict)
    explore(pict)
  </code></pre>
  
  <h1>prog 2</h1>
  
  <pre><code>def chromeKey(pict)
    for x in range(0, getWidth(pict)):
      for y in range(0, getHeight(pict)):
        pix = getPixel(pict, x, y)
        if(getRed(pix) + getGreen(pix) &lt; getBlue(pix)):
          setColor(pix, getColor(getPixel(canvas,x,y)))
    return pict
  </code></pre>
  
  <p>prog 3: this is supposed to  write a prog to blend two pics, 1. blend the top third of the 1st pic 2. then bled two pics tpgether in the middle third, 3. then show the last third of the second pic</p>
  
  <h1>program to set source images at the same size</h1>
  
  <pre><code>def blendImg():
    #mark on the moon
    a = pickAFile()
    source = makePicture(a)
    #WaterFall
    b = pickAFile()
    secondImg = makePicture(a)
    sHeight = getHeight(secondImg)
    sW = getWidth(secondImg)
    canvas = makeEmptyPicture(sHeight, sW)
    #Copy of pic 1, 94columns(1/3 of image)
    sourceX=0
    for targetX in range(0,94):
      sourceY=0
      for targetY in range(0, getHeight(source)):
        color = getColor(getPixel(source,sourceX,sourceY))
        setColor(getPixel(canvas,targetX,targetY),color)
        sourceY = sourceY + 1
      sourceX = sourceY + 1
     #actual blending
      blend = getWidth(source)-94
      sourceX=0
      for targetX in range(150,getWidth(source)):
        sourceY=0
        for targetY in range(0,getHeight(secondImg)):
          sPixel = getPixel(source,sourceX+94,sourceY)
          sImgPixel = getPixel(secondImg,sourceX,sourceY)
          newRed = 0.25*getRed(sPixel)+0.25*getRed(sImgPixel)
          newGreen = 0.25*getGreen(sPixel)+0.25*getGreen(sImgPixel)
          newBlue = 0.25*getGreen(sPixel)+0.25*getGreen(sImgPixel)
          nColor = makeColor(newRed,newGreen,newBlue)
          setColor(getPixel(canvas,targetX,targetY),nColor)
          sourceY = sourceY+1
        sourceX = sourceX+1
        sourceX=blend
        for targetY in range(94+blend,94+getWidth(secondImg)):
          sourceY=0
          for targetY in range(0,getHeight(secondImg)):
            color = getColor(getPixel(secondImg,sourceX,sourceY))
            setColor(getPixel(canvas,targetX,targetY),color)
            sourceY = sourceY + 1
          sourceX = sourceX + 1
      show(canvas)
      return(canvas)
  </code></pre>