def showMediaPath(): setMediaPath() # print "Select file C:\\Users\\troy cs100\\football.jpg" # print pickAFile() pict = makePicture("football.jpg") show(pict) def posterize(): file = pickAFile() pict = makePicture(file) # loop for all pixels in the picture for pixel in getPixels(pict): redAmount = getRed(pixel) greenAmount = getGreen(pixel) blueAmount = getBlue(pixel) # modify red value if (redAmount >= 100): setRed(pixel, 100) if (redAmount < 100): setRed (pixel, 1) # modify green value if (greenAmount >= 192): setGreen(pixel, 255) if (greenAmount < 192): setGreen (pixel, 32) # modify blue value if (blueAmount >= 128): setBlue(pixel, 128) if (blueAmount < 128): setBlue (pixel, 20) show (pict)