title: How can I save an image with PIL?
body: <p>I have just done some image processing using the Python image library (PIL) using a post I found earlier to perform fourier transforms of images and I can't get the save function to work. The whole code works fine but it just wont save the resulting image:</p>
  
  <pre><code>from PIL import Image
  import numpy as np
  
  i = Image.open("C:/Users/User/Desktop/mesh.bmp")
  i = i.convert("L")
  a = np.asarray(i)
  b = np.abs(np.fft.rfft2(a))
  j = Image.fromarray(b)
  j.save("C:/Users/User/Desktop/mesh_trans",".bmp")
  </code></pre>
  
  <p>The error I get is the following:</p>
  
  <pre><code>save_handler = SAVE[string.upper(format)] # unknown format
      KeyError: '.BMP'
  </code></pre>
  
  <p>How can I save an image with Pythons PIL?</p>