title: How do I read image data from a URL in Python?
body: <p>What I'm trying to do is fairly simple when we're dealing with a local file, but the problem comes when I try to do this with a remote URL.</p>
  
  <p>Basically, I'm trying to create a PIL image object from a file pulled from a URL.  Sure, I could always just fetch the URL and store it in a temp file, then open it into an image object, but that feels very inefficient.</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>Image.open(urlopen(url))
  </code></pre>
  
  <p>It flakes out complaining that <code>seek()</code> isn't available, so then I tried this:</p>
  
  <pre><code>Image.open(urlopen(url).read())
  </code></pre>
  
  <p>But that didn't work either.  Is there a Better Way to do this, or is writing to a temporary file the accepted way of doing this sort of thing?</p>