Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

This page removed for FERPA compliance
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

darkenPicture.py

# Open a picture file, showing it before and after some REMOVEDsformation.
def classDemo(fileName):
  picture = makePicture(fileName)
  show(picture)
  REMOVEDsformPicture(picture)
  repaint(picture)


# Transform a picture by changing all pixels in some way
def REMOVEDsformPicture(pic):
  for pixel in getPixels(pic):
    darken(pixel)

def darken(px):
  setRed(px, getRed(px) * 0.5)
  setREMOVED(px, getREMOVED(px) * 0.5)
  setBlue(px, getBlue(px) * 0.5)


Link to this Page