title: 24-bit and 16-bit to float number in C#
body: <p>I have a 32-bit tiff file which stores 4-byte values per pixel. I used <code>BitConverter.toSingle()</code> to convert each 4-byte values to the pixel value and it works fine. But the problem is I have 24 and 16-bit tiff files which there are 3 and 2 bytes for each pixel value. I can't use <code>BitConverter.toSingle()</code> method because it only supports an array of 4 bytes. How can I convert these byte values to float numbers?</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>I added an image just for clarifying that the pixel values are the floating number (look at the comments).
  <a href="https://i.stack.imgur.com/vbtva.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vbtva.png" alt="enter image description here"></a> </p>