Solution to Exercise 4

  1. A 200x300 image with 8 colors.

    The first step is finding the bit-depth, which is 3 because 23 is not less than 8.

    With the simpler formula, we get:

    200 * 300 * 3 / 8 = 180,000 / 8 = 22,500
    or about 22.5 KB.

    With the more complex formula, we get:

    200 * 300 * 3 / 8 + 3 * 8 = 22,500 + 24 = 22,524
    or, again, about 22.5 KB.
  2. A 200x300 with 32 colors.

    The first step is finding the bit-depth, which is 5.

    With the simpler formula, we get:

    200 * 300 * 5 / 8 = 300,000 / 8 = 37,500
    or about 37 KB.

    With the more complex formula, we get:

    200 * 300 * 5 / 8 + 3 * 32 = 37,500 + 96 = 37,596
    or, again, about 37 KB
  3. A 400x400 image with 32 colors:

    The bit-depth is again 5.

    With the simpler formula, we get:

    400 * 400 * 5 / 8 = 800,000 / 8 = 100,000

    With the more complex formula, we get:

    400 * 400 * 5 / 8 + 3 * 32 = 100,000 + 96 = 100,096
  4. A 400x400 image with 19 colors:

    The bit-depth is again 5! Why? So the simpler formula has the same answer. The more complex formula is slightly different:

    400 * 400 * 5 / 8 + 3 * 19 = 100,000 + 57 = 100,057
  5. A 400x400 image with 33 colors:

    The bit-depth is now 6! Why?

    With the simpler formula, we get:

    400 * 400 * 6 / 8 = 960,000 / 8 = 120,000

    With the more complex formula, we get:

    400 * 400 * 6 / 8 + 3 * 33 = 120,000 + 99 = 120,099
  6. A 400x400 image with 250 colors:

    The bit-depth is 8.

    With the simpler formula, we get:

    400 * 400 * 8 / 8 = 160,000

    With the more complex formula, we get:

    400 * 400 * 8 / 8 + 3 * 250 = 160,000 + 750 = 160,750