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)
```

Computer Science & Information Technology

You might also like to view...

What is a business case?

A. a document that outlines security goals but does not give any specific ways to accomplish the stated goals B. the desired results from the security plan C. a plan of action or a policy designed to achieve a major or overall aim D. a formal document that gives the reasons behind an organizational project or initiative and usually incudes financial justification for the project or initiative

Computer Science & Information Technology

A line of people waiting for the bus at a bus station is an example of a real life queue.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology