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 Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Answer 3.6

# Template to get and show a picture file;
# Loop through and process each pixel;
# Do something with new picture
def redBlue(file):
  #Part 1 - Get and show a picture file. REMOVEDose from Template1.
  picture = makePicture(file)
  show(picture)
  
  #Part 2 - Loop through picture and process each pixel.	
  for pixel in getPixels(picture):
    blue_value = getBlue( pixel )
    setRed(pixel, blue_value)
  
  #Part 3 - Do something with new picture
  repaint(picture) 


Link to this Page