Monochrome
def monochrome(pic):
for pixel in getPixels(pic):
value = (getRed(pixel) + getGreen(pixel) + getBlue(pixel)) / 3
setRed(pixel, value)
setGreen(pixel, value)
setBlue(pixel, value)
def sepia(pic):
for pixel in getPixels(pic):
value = (getRed(pixel) + getGreen(pixel) + getBlue(pixel)) / 3
setRed(pixel, value)
setGreen(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