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?
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.
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
resize.c problems if you don't rush through the questions -- especially the ones about the
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!