title: Python: Manipulating a 16-bit .tiff image in PIL &/or pygame: convert to 8-bit somehow?
body: <p><img src="https://i.stack.imgur.com/GkUgZ.png" alt="enter image description here">Hello all,</p>
  
  <p>I am working on a program which determines the average colony size of yeast from a photograph, and it is working fine with the .bmp images I tested it on.  The program uses pygame, and might use PIL later.</p>
  
  <p>However, the camera/software combo we use in my lab will only save 16-bit grayscale tiff's, and pygame does not seem to be able to recognize 16-bit tiff's, only 8-bit.  I have been reading up for the last few hours on easy ways around this, but even the Python Imaging Library does not seem to be able to work with 16-bit .tiff's, I've tried and I get "IOError: cannot identify image file".</p>
  
  <pre><code>import Image
  
  img = Image.open("01 WT mm.tif")
  </code></pre>
  
  <p>My ultimate goal is to have this program be user-friendly and easy to install, so I'm trying to avoid adding additional modules or requiring people to install ImageMagick or something.</p>
  
  <p>Does anyone know a simple workaround to this problem using freeware or pure python?  I don't know too much about images: bit-depth manipulation is out of my scope.  But I am fairly sure that I don't need all 16 bits, and that probably only around 8 actually have real data anyway.  In fact, I once used ImageMagick to try to convert them, and this resulted in an all-white image: I've since read that I should use the command "-auto-levels" because the data does not actually encompass the 16-bit range.</p>
  
  <p>I greatly appreciate your help, and apologize for my lack of knowledge.</p>
  
  <p>P.S.: Does anyone have any tips on how to make my Python program easy for non-programmers to install?  Is there a way, for example, to somehow bundle it with Python and pygame so it's only one install?  Can this be done for both Windows and Mac?  Thank you.</p>
  
  <p>EDIT: I tried to open it in GIMP, and got 3 errors:</p>
  
  <p>1) Incorrect count for field "DateTime" (27, expecting 20); tag trimmed 
  2) Sorry, can not handle images with 12-bit samples 
  3) Unsupported layout, no RGBA loader </p>
  
  <p>What does this mean and how do I fit it?</p>