Activity #6 (lab): RGB Shots

We've learned that the colors of a digital picture are encoded using the RGB color model. This model is described in the texbook and WikiPedia also provides a good quality description of this RGB model. In WikiPedia's description, they have a picture along with three different pictures each showing only the red, green, or blue component of that original picture. Your job in this assignment is to write Java code to do exactly that!

Problems

It is recommended that you follow these steps in writing your code. Remember to abide by the programming style and documentation.

  1. Solve problems 4.10, 4.11, and 4.12 in the textbook.
  2. Be sure you've tested all of the methods you've written for the problems above. You can do your testing in the interactions pane, to be sure they are working.
  3. Now, write a Java program (remember a Java class with a main() method) that will display three Picture objects. The first Picture object displayed will be the original picture you've selected. The three additional Picture objects will be the ones where only the red component, blue component, and green component is kept.
  4. Be sure to solve problem 4.12 completely; that is, after writing the method try it out on different pictures and experiment to see what results you get. Be ready to show the results that you feel are the best!.

Example results

Check out what I got when I apply the methods written in 4.10 to a picture of Las Vegas.

Programming Resources