Introduction - If you have any usage issues, please Google them yourself
Realize the function of the code: 24-bit bitmap (BMP) of the gray. Concrete realization of the process: Open the image file, locate the data area (3 bytes per pixel on behalf of a R, G, B values), cyclic scan, according to the weight of RGB, gray value is calculated. If you want to get 256 colors grayscale, would create a new palette, modify the header and file header information.
Packet : 11714318924bmp256colorgray.rar filelist
24BMP256ColorGray.txt