'>>' means bit shift ? In delphi, there's shr command for this I think. Thanks for responce, I'll try this.
Edit: Actually, the unused bit is last, but first one, so binary values must be diffrent, already got that trick.
But now, how to convert it to 16-bit BMP format, which uses 3 bytes to describe one pixel ? Each of these colors is an integer in range 0..31, and in BMP file each color has 0..255. How to convert it ? Multiplying by 8 gives a 248 max value (or 8 minimal value).