[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?)
The 06-circle-alpha.png picture has the same color everywhere, so all of it
gets colorkeyed out. I think it's more fair to compare speeds when the results
look more or less the same with alpha or color key, and with realistic sprites.
Here are results with three sprites from one of my games. The cloud sprite has
very few completely transparent or completely solid pixels, while the other two
sprites have anti-aliased edges. Note that the cloud looks like complete crap
with colorkey blitting.
Conclusions:
* Anti aliased edges are pretty cheap (0.09 vs 0.10, 0.5 vs 0.7)
* RLEACCEL is a big win on all of these sprites.
Table: Blit times, normalized to 1.0 for no optimization. The sprites
are pretty small. 10000 blit average, on an ibook g4 running linux.
balloon draco cloud
no optimization
1.00 1.00 1.00
convert only 0.15 0.13 0.07
colorkey no RLEACCEL 0.25 0.36 0.40
colorkey with RLEACCEL 0.09 0.05 0.06
convert_alpha only 0.14
0.22 0.22
convert_alpha with RLEACCEL 0.10 0.07 0.15
Regards,
Ulf