Bitmap Representation Divide an image into a grid Pick the average color in each cell (pixel) Remember that color 1 Remember Average Pixel Color 2 Wednesday, November 2, 2011
Pixels are very small! 3 428 How Much Memory 1 RGB value = 3 bytes 640 428 x 640 x 3 = 821,760 bytes (821 KB) But file size is just 90 KB !! 4 Wednesday, November 2, 2011
Idea! Remember the 256 most frequent colors used in the picture Assign each of these colors a number from 0-255 (which fits in 1 byte) Remember this 1-byte number for each pixel. 5 Indexed Representation 20 162 230 181 220 222 68 ... 144 ... … ... ... ... ... 144 ... ... ... ... ... ... ... ... 6 Wednesday, November 2, 2011
Indexed Representation Size = size of color table + size of indexed picture Color table size = 256 * 3 bytes = 768 bytes Size of indexed picture = 428 x 640 = 273,920 bytes Total = 768 + 273,920 = 274,688 bytes 7 Wednesday, November 2, 2011
Recommend
More recommend