title: 10 bit values in a 16 bit image
body: <p>I am using C# to call a camera API in C++ which returns an image where each pixel is interpreted as a 2 byte value. However, the camera operates at 10 bits, so the image range is between 0 and 1023 inclusive.</p>
  
  <p>For the usual 8 bit images, I was doing:</p>
  
  <pre><code>Bitmap bmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed);
  ColorPalette ncp = bmp.Palette;
  for (int i = 0; i &lt; 256; i++)
      ncp.Entries[i] = Color.FromArgb(255, i, i, i);
  bmp.Palette = ncp;
  </code></pre>
  
  <p>Now, I want to similarly create the palette entries for my 10 bit images. My question is whether I should use 1024 entries or the full 16 bit 65536 entries even though my range will always be 0-1023.</p>