title: Bitmap storage / memory representation for N-bit RGB bitmaps
body: <p>Typically, the most common RGB format seems to be 24-bit RGB (8-bits for each channel).  However, historically, RGB has been represented in many other formats, <a href="http://en.wikipedia.org/wiki/List_of_color_palettes#Regular_RGB_palettes" rel="nofollow">including 3-bit RGB (1-bit per channel), 6-bit RGB (2-bits per channel), 9-bit RGB (3-bits per channel)</a>, etc.</p>
  
  <p>When an N-bit RGB file has a value of N that is not a multiple of 8, how are these bitmaps typically represented in memory?  For example, if we have 6-bit RGB, it means each pixel is 6 bits, and thus each pixel is not directly addressable by a modern computer without using bitwise operations.</p>
  
  <p>So, is it common practice to simply covert N-bit RGB files into bitmaps where each pixel is of an addressable size (e.g. convert 6-bit to 8-bit)?  Or is it more common to simply use bitwise operations to manipulate bitmaps where the pixel size is not addressable?</p>
  
  <p>And what about disk storage?  How is, say, a 6-bit RGB file stored on disk, when the last byte of the bitmap may not even contain a full pixel?</p>