img2dcm currently can only handle color BMP files (no color palette, 24 BPP), this is correct.
You could convert your graylevel BMP into such an image first, but you'd get a color DCM object, too.
Please note that AFAIK there are no "real" graylevel BMP images, there are always some kind of colors involved.
I'm not hundred percent sure, but I think a greylevel BMP is a color BMP in reality which just happens to use only gray-ish colors. So if one just took that and converted it into DICOM, one would still have a color image which only uses gray levels.
The image wouldn't have a LUT at all, but instead the default values for RescaleSlope and RescaleIntercept (which is basically a linear LUT, yeah).
As for converting your image to DICOM, the best suggestion I have currently would be convert the BMP to JPEG and feed that one to img2dcm.
There's also a palette color BMP format where the look-up table contains gray values only (i.e. identical values for the RGB components). Btw, this is also the format that is used as an output format for dcm2pnm with the following option:
maybe you meant, from a dicom file converting to a grayscale 8 bit BMP? yes, i know this option
but, what i am trying to do is the reverse, converting a 8 bit grayscale BMP to a dicom file, img2dcm refused..
i have to load the data from bmp, and create a dicom from raw data..and successful... so, in my program, i have to judge if the incoming file is true color or grayscale.. and then apply img2dcm or another program. a little bothersome, though.
maybe you meant, from a dicom file converting to a grayscale 8 bit BMP?
No, I was referring to the BMP format for grayscale images which is in fact a palette color image with 8 bits per pixel and a look-up table with 256 entries. So, as far as I know there is no such thing as an "8-bit grayscale BMP format".