1 | initial version |
If you simply want to store the 16 bit values into a 8 bit, 3 channel image, that's fine. Your method allows you to extract subwindows and things like that. If you don't care about that, then it's probably better just to copy it to the memory block, leaving the rest empty.
However, obviously, neither of these looks like an image if you display or process the data.
If you want it to still be an image, and you simply want to lose as little visual fidelity as possible, then you should look for Contrast Enhancement and Local Area Contrast Enhancement methods, such as Histogram Equalization, CLAHE, or one of the many many other methods that do LACE.