title: Creating image through input pixel values with the Python Imaging Library (PIL)
body: <p>I'm wanting to work on an idea using images but I can't get it to write pixel values properly, it always just ends up grey with some pattern like artefacts, and no matter what I try, the artefacts change but the image remains grey.</p>
  
  <p>Here's the basic code I have:</p>
  
  <pre><code>from PIL import Image
  data = ""
  for i in range( 128**2 ):
      data += "(255,0,0),"
  im = Image.fromstring("RGB", (128,128), data)
  im.save("test.png", "PNG")
  </code></pre>
  
  <p>There is no information in <a href="http://effbot.org/imagingbook/pil-index.htm" rel="noreferrer">http://effbot.org/imagingbook/pil-index.htm</a> on how to format <code>data</code>, so I've tried using 0-1, 0-255, 00000000-111111111 (binary), brackets, square bracks, no brackets, extra value for alpha and changing RGB to RGBA (which turns it light grey but that's it), comma after, and no comma after, but absolutely nothing has worked.</p>
  
  <p>For the record, I'm not wanting to just store a single colour, I'm just doing this to initially get it working.</p>