title: recommended way to download images in python requests
body: <p>I see that there are two ways to download images using python-reuqests.</p>
  <ol>
  <li><p>Uisng PIL as stated in docs (<a href="https://requests.readthedocs.io/en/master/user/quickstart/#binary-response-content" rel="nofollow noreferrer">https://requests.readthedocs.io/en/master/user/quickstart/#binary-response-content</a>):</p>
  <pre><code>from PIL import Image
  from io import BytesIO
  i = Image.open(BytesIO(r.content))
  </code></pre>
  </li>
  <li><p>using streamed response content:</p>
  <pre><code>r = requests.get(url, stream=True)
  with open(image_name, 'wb') as f:
      for chunk in r.iter_content():
          f.write(chunk)
  </code></pre>
  </li>
  </ol>
  <p>Which is the recommended wya to download images however? both have its merits I suyppose, and I was wondering what is the optimal approach.</p>