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

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