Create a movie that has the frames slowly becoming sepia-toned from left-to- right. Maybe you make sepia-toned the leftmost 10 columns of pixels in the first frame, then the leftmost 20 columns are made sepia-tones in the second frame, and so on.

What will be an ideal response?

```
def sepiaWipe(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 = sepiaTint(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") if num >= 10:
writePictureTo ( canvas , directory +"//frame"+ numStr +".jpg")
movie = makeMovieFromInitialFile(directory+"/frame00.jpg");
return movie

def sepiaTint(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)
value = getRed(p) + getBlue(p) + getGreen(p)
value = value/3

setRed(p, value)
setBlue(p, value)
setGreen(p, value)

#Loop through the picture and tint values
for x in range(xMin, xMax):
for y in range(yMin, yMax):
p = getPixel(picture, x, y)
redVal = getRed(p)
blueVal = getBlue(p)

#tint shadows
if (redVal<63):
redVal = redVal*1.1
blueVal = blueVal*0.9
#tint midtones
if (redVal > 62 and redVal< 192):
redVal = redVal*1.15
blueVal = blueVal*0.85

#tint highlights
if (redVal> 191):
redVal = redVal*1.08
if (redVal>255):
redVal = 255
blueVal = blueVal*0.93

#set the new color values
setRed(p, redVal)
setBlue(p, blueVal)
```

Computer Science & Information Technology

You might also like to view...

You can add the slide number, date, or time in a footer, but not in a header.

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

Computer Science & Information Technology

A(n) ____________________ is a named operation that replaces the arithmetic expression in a formula.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology