tags:

views:

131

answers:

3

Hi,

I am building an application in C# and .NET 2.0 which takes an 8 bit grayscale image as input, does some operation on the pixel values and writes back to the image. When I write the pixel values back to the bitmap, the image is being displayed in color. Please help me fix this problem.

Thanks, Rakesh.

+1  A: 

Replicate the gray value across all three channels.

drlaj
A: 

I don't know if 8-bit grayscale is supported. You simulate it by using an 8 bit palette, with each color in the palette being a shade of gray.

Mark Ransom
A: 

Thanks for the help guys. I figured out that I need to take help of color palette and all. For now, I created a new 24bit bitmap and wrote the values into it and its working fine.

Thanks, Rakesh.

Rakesh K