title: How can I read a binary file and turn the data into an image?
body: <p>Basically what I want to do is take a file, bring its binary data(decimal of course) into an list and then generate a grayscale bitmap image using PIL based on that list.</p>
  
  <p>For example if the file is 5000 bytes (image size will be 100 x 50) and each byte is an integer between 0 and 255, I want to paint the first byte to the first pixel and go down the row until all bytes are exhausted.</p>
  
  <p>The only thing I got so far is reading the file in:</p>
  
  <pre><code>f = open(file, 'rb')
  text = f.read()
  for s in text:
      print(s)
  </code></pre>
  
  <p>This outputs the bytes in decimal.</p>
  
  <p>I'm looking for some direction on how to accomplish this. I've done a lot of searching, but it doesn't seem too many have tried doing what I want to do.</p>
  
  <p>Any help would be greatly appreciated!</p>