SLIDE 4 3/12/2014 4
Practice problems (class participation homework)
Due on Tuesday, March 11 Blurring a picture (program 42)
The filename parameter of the blur function must
be the file name with complete path. Only “flower1.jpg” for filename will not work. Write the following in command area to get the complete path:
setMediaPath() filename = getMediaPath(“flower1.jpg”) blur(filename) #call the blur function with the
proper argument
Did you understand why the ranges in for loops
started at 1 and ended 2 short of width/height?
class participation homework (cont.)
Chromakey (Program 47)
Here, the source and bg parameters are picture
- bjects. File names as arguments will not work.
You will need to create the picture objects from the command area first. You can then supply those picture objects to the chromakey function. Here’s an example for creating these picture objects (type the following in command area):
file = getMediaPath(“blue-mark.jpg”) #assuming
setMediaPath() done previously
source = makePicture(file) file = getMediaPath(“moon-surface.jpg”) bg = makePicture(file) chromakey(source, bg) #call the chromakey function
with proper arguments