Template2
# Template to get and show a picture file;
# Loop through and process each pixel;
# Do something with new picture
def <function name>():
#Part 1 - Get and show a picture file. Choose from Template1.
file = '<file name>.jpg'
picture = makePicture(file)
show(picture) <or openPictureTool(picture)>
#Part 2 - Loop through picture and process each pixel.
for pixel in getPixels(picture):
<do something to each pixel>
#Part 3 - Do something with new picture
repaint(picture)
<or openPictureTool(picture), writePictureTo(picture, path)>
Links to this Page
- Excersise Set 1 last edited on 24 January 2007 at 4:59 am by c-24-99-178-198.hsd1.ga.comcast.net
- Spring 2007 materials last edited on 21 August 2007 at 10:44 pm by user-1121vkp.dsl.mindspring.com