Write a function that posterizes an input picture along a very specific process. If the red value is greater than 180, then set the pixel to red. If not, then check if the blue value is greater than 180, and if so, set the pixel to blue. If not, then check if the green value is greater than 180, and if so, set the pixel to green. If none of the three channels is greater than 180, set the pixel to black.

What will be an ideal response?


```
def posterize(picture):
for p in getPixels(picture):
if getRed(p)>180:
setColor(p,red)
elif getBlue(p)>180:
setColor(p,blue)
elif getGreen(p)>180:
setColor(p,green)
else:
setColor(p,black)
```

Computer Science & Information Technology

You might also like to view...

The sh ip route command is entered on RouterB in the campus LAN shown in Figure 9-18. The LAN has been fully configured to run EIGRP. How many EIGRP subnets are running on the network? Identify the connected C and EIGRP D subnets.

Figure 9-18

Computer Science & Information Technology

In addition to archiving email messages, Outlook provides ____ tools to help control the size of your mailbox.

A. cleanup B. analytical C. website D. deletion

Computer Science & Information Technology

To manually adjust the width of a column, position the pointer over the vertical line between two column headings so that the pointer changes to a shape. _____ while you drag the vertical line left or right to manually adjust the width of the column.

A. Double-click the right mouse button B. Press and hold the right mouse button C. Double-click the left mouse button D. Press and hold the left mouse button

Computer Science & Information Technology

The first binary octet of a Class C IP address always begins with 110 (110xxxxx).

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

Computer Science & Information Technology