Create a function that takes a picture and creates a movie with the picture slowly turning into the negative from left-to-right. Maybe you do the leftmost 10 columns of pixels in the first frame, then the leftmost 20 columns are made negative in the second frame, and so on.
What will be an ideal response?
```
def invertWipe(directory, picture):
#if each frame has 10 pixels changed, max frame is width/10
width = getWidth(picture)
height = getHeight(picture)
for num in range (1 ,width/10):
canvas = makeEmptyPicture (width,height)
pic = invertColor(picture,(num-1)*10,num*10, 0, height)
copy(pic, canvas, 0, 0)
numStr=str(num)
if num < 10:
writePictureTo ( canvas , directory +"//frame0"+ numStr +".jpg")
elif num >= 10:
writePictureTo ( canvas , directory +"//frame"+ numStr +".jpg")
movie = makeMovieFromInitialFile(directory+"/frame00.jpg");
return movie
def invertColor(picture, xMin, xMax, yMin, yMax):
#Convert section to grayscale
for x in range(xMin, xMax):
for y in range(yMin, yMax):
p = getPixel(picture, x, y)
setRed(p, 255-value)
setBlue(p, 255-value)
setGreen(p, 255-value)
```
You might also like to view...
Ethernet uses which of the following access methods?
a. random access b. CSMA/CD c. time division d. polling
Write a new method to maximize blue instead of clearing it use as a starting point.
Is this useful? Would the red or green versions be useful? In the theater they often use color ¯lters to express a mood. Red is often used to make things seem scary or angry. Blue might be used to make it look like things are underwater or at night.
Bill leaves Chicago at 4:00P.M. traveling east on Interstate 90 at 70 miles per hour toward Toledo. Also at 4:00 P.M., Jim leaves Toledo, 200 miles east of Chicago and heads west for Chicago at 50 miles per hour. At 5:00 P.M. they both stop for one hour for dinner and then continue at their previous speeds. At what time will Bill pass Jim?
Solve the following time-rate-distance problems using the IPO method. Ignore time zones.
Word tabs, such as the File and Home tabs, are organized in groups on the ____.
A. Ribbon B. Status bar C. Title bar D. Quick Access toolbar