title: pygame image size in kb (not in pixels)
body: <p>How get from <i>pygame.image</i> size (in kb/bytes) in memory? Unfortunately, there is no direct method to check the size of the <i>surface</i>.</p>
  
  <p>For the test, i have 2 files (39kb and 1.9mb)</p>
  
  <pre><code>aa = pygame.image.load(filename).convert_alpha()
  bb = pygame.image.load(filename2).convert_alpha()
  print sys.getsizeof(aa)
  print sys.getsizeof(bb)
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>64
  64
  </code></pre>
  
  <p>This is (probably) variable size, not stored image.
  The only thing I came up with was tostring:</p>
  
  <pre><code>print "Size %d" % sys.getsizeof(pygame.image.tostring(aa, "RGBA")) 
  print "Size %d" % sys.getsizeof(pygame.image.tostring(bb, "RGBA")) 
  </code></pre>
  
  <p>And got: </p>
  
  <pre><code>Size 637 
  Size 39923749
  </code></pre>
  
  <p>38mb ? Strange and not accurate. How check real memory usage?</p>
  
  <p>BR
  Parasit</p>