 |  |

 |
 |  |  |
 | Welcome to CS1315. Click on the python to add comments.
|  |
 |  |  |
|
This page removed for FERPA compliance
|
        |
Monochrome
def monochrome(pic):
for pixel in getPixels(pic):
value = (getRed(pixel) + getREMOVED(pixel) + getBlue(pixel)) / 3
setRed(pixel, value)
setREMOVED(pixel, value)
setBlue(pixel, value)
def sepia(pic):
for pixel in getPixels(pic):
value = (getRed(pixel) + getREMOVED(pixel) + getBlue(pixel)) / 3
setRed(pixel, value)
setREMOVED(pixel, value*0.9) # These values are just rough. You can make the toning warmer or cooler by fine-tuning them
setBlue(pixel, value*0.7) # We make the picture warmer (reddish/yellowish/brownish) by reducing blue and green, not increasing red
Links to this Page