title: Save contour as image
body: <p>I am trying to convert a folder to show the contours of each image. The code will show the image when I plot it, but not save it to image. How can I save it to an image ?</p>
  
  <p>Current error message : </p>
  
  <pre><code>ValueError: 'arr' does not have a suitable array shape for any mode.
  
  
  import matplotlib.pyplot as plt
  import os
  from PIL import Image
  
  i=0
  directory_in_str='C:\\directory'
  directory_output='C:\\output_directory'
  for file in os.listdir(directory_in_str):
          print(file)
  
          # read image to array
          im = array(Image.open(join(directory_in_str,file)).convert('L'))
  
          # show contours with origin upper left corner
          im = plt.contour(im, levels=[100], colors='black', origin='image')
  
          scipy.misc.imsave(directory_output +'image' + str(i) + '.jpg', im)
          i+=1
  
  print('done')
  </code></pre>
  
  <p>Thanks ! </p>