Template3
# Template to get and show a picture file;
# Loop through a range of pixels and do something to them;
# 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 x in range(<start_x>, <stop_x>+1, <step_x>):
for y in range(<start_y>, <stop_y+1>, <step_y>):
<do something to each pixel>
#Part 3 - Do something with new picture
repaint(picture)
<or openPictureTool(picture), writePictureTo(picture, path)>
Link to this Page