Hey I need a little help with pset4's first question - How many different colors does each format support? So as per my understanding each format supports just the three colors- red, green and blue. But depending upon the the bits they support per color, the amount of color they can represent can vary. Like for both JPEG and PNG, 16 million colors are repsented as they both support 8-bit per color, but GIF supports only 256 color due to its 8 bit palette. So am I wrong?

1 Answer 1


You are basically correct:

BMP supports up to 24-bit (16 million colors) and 256 shades of gray.
GIF supports up to 8-bit (256 colors) and 256 shades of gray.
JPEG supports 24-bit (16 million colors) and 256 shades of gray.
PNG supports up to 48-bit (256 teracolors!) and 65,536 shades of gray.

BMP and PNG also have low-color modes which are more comparable to GIF.

Info from http://www.aivosto.com/vbtips/imageformats.html

Make sure that you research all of the questions in this problem set thoroughly, and understand the answers completely. You'll have a much easier time with the whodunit.c and resize.c problems if you don't rush through the questions -- especially the ones about the BITMAPFILEHEADER and BITMAPINFOHEADER specifications, and the way padding is calculated.

If this answers your question, please click the green check mark to accept my answer. Otherwise, the forum will forever list this question as unanswered!

  • I'm working on this same problem. This may be elementary, but could you draw out a math example that gives the bit amounts to millions figuring? I would like to feel like I can calculate the answers based on my knowledge of bits, but I just can't. I would appreciate a very rudimentary explanation. Many thanks! Commented Nov 11, 2016 at 1:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .