Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Fall 2007 Test 1 Review: Generalized image filter

Post questions here.
I thought I would have to use "if" loops, but I ended up not using them.

def changeRGB(fn,redValue,greenValue,blueValue):
  pic = makePicture(fn)
  for p in getPixels(pic):
    setRed(p,getRed(p)*(1+redValue))
    setGreen(p,getGreen(p)*(1+greenValue))
    setBlue(p,getBlue(p)*(1+blueValue))
  show(pic)

Alex Young
why is there no fn=pickAFile()?
That code is wrong. We told you to pass in a picture, not a file. That is also why there is no "pickAFile()". Thanks! Brittany Duncan
do we have to make picture?
If the first argument is a picture, as specified in the question, you don't need to make one. Colin Potts
I see I did not read the directions. :( Alex Young

def changeRGB(pic,redValue,greenValue,blueValue):
  for p in getPixels(pic):
    setRed(p,getRed(p)*(1+redValue))
    setGreen(p,getGreen(p)*(1+greenValue))
    setBlue(p,getBlue(p)*(1+blueValue))
  show(pic)





Link to this Page