title: Creating a good quality grayscale image from an multidimensional numpy array
body: <p>I have an array that is 50(rows) by 33(columns). I am importing it to a numpy array on python. The values on my array range from 0 to 4096, so I am scaling it to 0-255 and then I trying to create a grayscale image from it, and save it. </p>
  
  <pre><code>    import numpy
      from PIL import Image
      data =  numpy.loadtxt('result.txt',delimiter='\t',dtype=None)
      rescaled = (255.0 / 4096 * (data)).astype(numpy.uint8)
      image = Image.fromarray(rescaled)
      image.save('test_fullsize.jpeg', quality=95)
  </code></pre>
  
  <p>This does not output any errors, however the produced image is only 50x33 pixels. This means the picture is very small(i can see that it is indeed the type of image I am looking for, however it is very very small)</p>
  
  <p>I tried resizing the image by adding this line of code before I save it:</p>
  
  <pre><code>image = image.resize((480, 640), Image.ANTIALIAS)
  </code></pre>
  
  <p>However, that outputed a very pixelated(bad quality) 480,640 image. I need this image to be of a decent resolution/size to be able to put it on a poster.</p>
  
  <p>Thank you.</p>