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