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)
```
You might also like to view...
The keys in the bottom row on a computer keyboard are called function keys.
Answer the following statement true (T) or false (F)
What is the data rate for Fast Ethernet?
a. 10Mbps b. 100Mbps c. 1000Mbps d. 10Kbps e. None of these answers is correct.
What is the purpose of a VLAN database?
What will be an ideal response?
Write a function that decreases red by 50% on the left side of the picture, and increases it by 200% on the right side.
What will be an ideal response?