title: Python, how can I asynchronously save the PIL images?
body: <p>For asynchronous file saving, I can use <code>aiofiles</code> library.</p>
  <p>To use <code>aiofiles</code> library I'd have to do something like that:</p>
  <pre><code>async with aiofiles.open(path, &quot;wb&quot;) as file:
     await file.write(data)
  </code></pre>
  <p>How can I asynchronously save the PIL images? Even if I use <code>Image.tobytes</code> function to save it with <code>file.write(data)</code>, the saved image isn't correct.</p>
  <p>So how can I asynchronously save a PIL image?</p>