title: Is there a way to examine how much memory an image is occupying with python?
body: <p>pillow provides <code>size</code> to examine the resolution of an image.</p>
  
  <pre><code>&gt;&gt; from PIL import Image
  &gt;&gt; img = Image.open('Lenna.png')
  &gt;&gt; img.size
  (512, 512)
  </code></pre>
  
  <p>is there a way to examine how many memory the image is occupying? is the image using 512*512*4 Bytes memory?</p>