Write a function to create a lightened grayscale image, by use makeLighter. First, lighten the image by using the makeLighter function on each color. Now, grayscale the new image. Compare the result to the picture created by the previous problem. How does makeLighter compare to adding 75 to each of the red, green, and blue components of every pixel?
What will be an ideal response?
```
def grayscale3(picture):
for p in getPixels(picture):
color = getColor(p)
color = makeLighter(color)
setColor(p,color)
intensity = (getRed(p)+getGreen(p)+getBlue(p))/3
setColor(p,makeColor(intensity ,intensity ,intensity))
```
Adding 75 to each red, green, and blue component outputs a much brighter image than using makeLighter, except when using an already very bright image with wrapping turned off.
You might also like to view...
Answer the following statements true (T) or false (F)
1. To create a Check Changed event handle for a Radio Button or a Check Box, double-click the control in the Designer. 2. A switch statement’s test expression can be any data type. 3. Once you create a List Box control, you add items to its Collection property. 4. When displaying an item from a List Box, you have to call the Selected Item property’s To String method to retrieve the value as a string.
The recursion step should:
a. check for the base case. b. call a fresh copy of the recursive method to work on a smaller problem. c. make two calls to the recursive method. d. iterate until it reaches a termination condition.
Supply chain management systems are a type of transaction processing system.
Indicate whether the statement is true or false.
To edit ranges in formulas, click the name of the range that you want to edit from the ____ dialog box.
A. Name Manager B. Define Name C. Create from Selection D. Lookup & Reference