24bit and 16bit floating point number in C #

I have a 32 bit tiff file that stores 4 byte values โ€‹โ€‹per pixel. I used BitConverter.toSingle()

to convert each 4 byte value to pixel value and it works great. But the problem is that I have 24 and 16 bit tiff files for which there are 3 and 2 bytes for each pixel value. I cannot use the method BitConverter.toSingle()

because it only supports 4 byte array. How do I convert these byte values โ€‹โ€‹to floating point numbers?

Update 1:

I added an image just to clarify that the pixel values โ€‹โ€‹are floats (look at the comments). enter image description here

+3


source to share





All Articles