[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Benchmarking alpha blits (was Re: How do I make a image transparent?)



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ethan Glasser-Camp wrote:
> Content-Type: image/svg+xml;

I have no idea what happened here. I sent a follow-up email to try to
rephrase, but it hasn't gone through yet. Maybe it needs to be
moderated; it's 107 KB. I've decided to take the attachments and put
them online instead of attaching them. They're at:

http://betacantrips.com/attic/pygame-blits/pygame-blits.csv

http://betacantrips.com/attic/pygame-blits/pygame-plot-graph1.png

http://betacantrips.com/attic/pygame-blits/pygame-plot-graph2.png

Here's the text:


Yikes, what happened here?

As I was trying to say:

I took the liberty of converting your numbers into CSV and
constructing a few plots. No hard-and-fast conclusions, especially
without some idea of the alpha values in the images, but:

1) without RLE, colorkey can be one of the slowest things you can do
- -- possibly even slower than alpha?

2) a colorkey that isn't in your image is worse than a colorkey that
is -- presumably the same number of checks must be performed, but more
pixels are blitted because none match the colorkey.

3) sometimes alpha with RLE is slower than alpha without RLE (the last
image). I would guess this is due to a widely varying number of alpha
values, for which RLE doesn't cut down on memory use but inflates it?

4) sometimes colorkey with RLE is much faster than alpha (a factor of
2-4x on some images).

Thanks Casey for these numbers! And also thanks for the code, using
"from __main__ import" is very clever and I'll have to use it in the
future.

Ethan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG7WP/hRlgoLPrRPwRAjrfAKDUbSvErLZscgfjnqEsWPimyGBOuQCfW66f
VYFXKf2hEEHtZR4Hn5v4XHE=
=XL52
-----END PGP SIGNATURE-----