Writing to a 8 bit grayscale image in C#
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.
Replicate the gray value across all three channels.
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.
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.
精彩评论