title: Binary image type in C
body: <p>If I want to create and work on a binary image in C, what data type should be set for the image pixels? Since a binary image pixel only has two values I am assuming I just need one bit for each pixel and thus I have to use the bit wise C functions, is this the correct (most efficient) way to do binary image processing in C? </p>
  
  <p>If that is the case, how can I allocate space for the image? <code>malloc</code> only allocates space in units of bytes if I am not mistaking. </p>
  
  <p>For clarification: I have a 32bit float image (with known size), I apply a threshold and would like to save the thresholding result as a binary so I can label the separate components.</p>