Sunday, November 27, 2011

Assignment 33: Image Encoding

1. An image is 800 by 500 pixels, and each pixel can be one of four color. How much memory would it require?
Four color = 2-bit code       800 pixels x 500 pixels = 400,000 pixels
A 00                                      2 x 400,000 = 800,000 bits
B 01                                      800,000/8 = 100,000 bytes
C 10                                      kilo = 1,000 so, 100,000/1,000 = 100 kBytes of memory
D 11


2. An image is 800 by 500 pixels, and each pixel can be one of four colors. How much storage space would it require?
Four color = 2-bit code     800 pixels x 500 pixels = 400,000 pixels
A 00                                    2 x 400,000 = 800,000 bits
B 01                                    800,000/8 = 100,000 bytes
C 10                                    kilo = 1,000 so, 100,000/1,000 = 100 kBytes of storage
D 11

3. How many different colors could one represent using two, three, and four bit codes?
2-bit code = 4 colors        3-bit code = 8 colors          4-bit code = 16 colors
A 00   C 10                        A 000      E 100                  A 0000      E 0100      I 1000      M 1100
B 01   D 11                        B 001      F 101                   B 0001      F 0101      J 1001      N 1101
                                          C 010      G 110                   C 0010      G 0110     K 1010     O 1110
                                          D 011      H 111                   D 0011     H 0111      L 1011     P 1111

4. When you add one bit to a code, what happens to the number of possible colors?
The number of possible colors increases if you add one bit to a code.
                                                                                      
                                                                                     

No comments:

Post a Comment