For your third lab you’ll continue to work on basic color manipulation. Most of the problems you’re assigned benefit from the kind hierarchical decomposition described in section 4.4. Be on the look out for these opportunities and design your code accordingly. As always, don’t forget that at the end of chapters 2 and 4 there are a Programming Summary sections that provides a quick dictionary of all of the important function and encoding names introduced thus far. When you run into problems don’t forget to check the Common Bugs and Debugging Tips scattered throughout the chapters as well.

From Chapter 4 do the following problems: 4.20, 4.21, 4.22, 4.23, and the two problems described below.

  1. Thus far our efforts to red,green, or blue-ify an image have involved boosting the target color while reducing the other colors (see 4.20). For this problem try first converting the image to greyscale and then boosting the target color. Pick one color to work with. Play with different ways of boosting the target (add some fixed value or multiply by some factor) and find something that produces a result that you’re happy with. How do the results compare to the techniques you used in 4.20?
  2. Design a function to purple-ify an image. If purple isn’t your thing, pick another color that isn’t pure red, green, or blue.
  • As always switch the driver (person typing the code) and navigator (person watching, helping spot typos, etc.) on every new problem.
  • Do all of the problems in a single python file. Put everyone’s name in a comment at the top of the file. Label the start of each problem with a comment.
  • For any problem that includes responding to questions as well as interacting with python code, write your responses as a comment. along with the required code.
  • Build a habit of testing now (see 4.3.3). Test everything your write. Verify that the color values change the way you expect them to change.
When you're done or when time is up, whichever comes first, print your code and hand it in. You might also want to email a copy of your document to the group so everyone has it. If you did not finish the problems, it will not hurt your grade. You are encouraged to work them out before class Wednesday, but are not required to do so. </h3>