title: scikit-image save image to a bytestring
body: <p>I'm using <a href="http://scikit-image.org/" rel="noreferrer">scikit-image</a> to read an image:</p>
  
  <pre><code>img = skimage.io.imread(filename)
  </code></pre>
  
  <p>After doing some manipulations to <code>img</code>, I'd like to save it to an in-memory file (a la <a href="http://docs.python.org/2/library/stringio.html" rel="noreferrer"><code>StringIO</code></a>) to pass off to another function, but it looks like <a href="http://scikit-image.org/docs/dev/api/skimage.io.html#imsave" rel="noreferrer"><code>skimage.io.imsave</code></a> requires a filename, not a file handle.</p>
  
  <p>I'd like to avoid hitting the disk (<code>imsave</code> followed by read from another imaging library) if at all possible. Is there a nice way to get <code>imsave</code> (or some other scikit-image-friendly function) to work with <code>StringIO</code>?</p>