views:

193

answers:

3

Hello.

I am trying to make a program that outputs a 8-bit grayscale image to bmp file. I have found out that 8-bit BMP files are indexed. Is it possible to omit the color table and just put values instead of indexes in the color table? Or BMP format does not allow this?

+1  A: 

You still need the LUT but it's very simple to create it. It's just 256 entries where the red, green and blue components are all equal to the grey scale intensity.

Paul R
Ok. So there is no way to omit the look-up table?
mm
AFAIK the only BMP format where you can omit the LUT is 24-bit RGB (for obvious reasons it's not needed in this case).
Paul R
A: 

Yes. If the colours are indexed, than you can set it to just the colours you want.

Code example

MPelletier
A: 

According to Wikipedia:

Images of 8 bits and fewer can be either grayscale or indexed color.

RedFilter
OK...but that actually answer the question.
The Elite Gentleman