CECS 471  Project #1 Due Tu July 18

Read and write image files that use four colors.  Images will be binary files.  For simplicity we will use four colors of your choice.  The first 12 bytes of the image file will be the RGB components of the four chosen colors.  For example 255 255 0 128 0 128 0 0 200 0 192 192.  The next two bytes will be the width and height of the image in pixels, say 40 30.  The remaining bytes of the file will use one byte to hold the numbers 0, 1, 2, or 3 representing the four colors used in the image. (We could actually compress and use 2 bits for each pixel, but letÕs not bother).  In the case of 40 by 30 that would be another 1200 bytes.

Write an image file using this format that contains four vertical stripes using each of the four colors.  Create the image, save it, and then read it to draw the image.  Use a standalone Java application.  Read and display (black-and-white ok) your image and the image from the test file at http://www.cecs.csulb.edu/~artg/471/image.  

Submit a hard copy of the code with output from test runs.