Write a function to blend two pictures, starting with the top third of the first picture and then blend the two together in the middle third and then show the last third of the second picture. This works best if the two pictures are the same size.

Assuming the same size in this response is acceptable


```
def blendTwoPictures(pict,secondPict):
firstThird = getHeight(pict)/3.0
secondThird = (2*getHeight(pict)/3.0)
for px in getPixels(pict):
x = getX(px)
y = getY(px)

if (y>firstThird) and (y redValOne = getRed(px)/2
greenValOne = getGreen(px)/2
blueValOne = getBlue(px)/2

secondPx = getPixel(secondPict,x,y)
redValTwo = getRed(secondPx)/2
greenValTwo = getGreen(secondPx)/2
blueValTwo = getBlue(secondPx)/2

setColor(px, makeColor(redValOne+redValTwo, greenValOne+greenValTwo,
blueValOne+blueValTwo))
elif (y>secondThird-1):
secondPx = getPixel(secondPict,x,y)
pxcol = getColor(secondPx)
setColor(px,pxcol)
```

Note: Since we just make changes to the first picture there’s no reason to do anything for the first third.

Computer Science & Information Technology

You might also like to view...

Holding down the power button for several seconds _____.

A. turns the computer off B. puts the computer to sleep C. restarts the computer D. makes the computer hibernate

Computer Science & Information Technology

A(n) ____________________ is a process to evaluate a help desk or support worker according to established criteria.

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

Computer Science & Information Technology

Which of the following is NOT true about assistive technologies?

A. Screen readers provide alternative sensory guidance for computer navigation. B. TDD technology helps the visually impaired. C. Talking checkbooks are an example of voice-recognition applications. D. Special Internet browsers can read HTML pages aloud.

Computer Science & Information Technology

Match the items in the figure below with their corresponding identities


a) ______ server name or subdomain
b) ______ extension
c) ______ protocol
d) ______ directory
e) ______ file name
f) ______ domain name

Computer Science & Information Technology