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

Re: [pygame] alpha overlap



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

Em Wednesday 20 August 2003 20:09, azazel escreveu:
> Hi, I've a question for you, a total opaque image has alpha value=255,
> but if I ovelap for instance 10 times the same image with alpha=25(and the
> last with alpha=30) I don't obtain a fully opaque image, why?
> [...]

Because alpha overlaying is not linear. If an image has an alpha of 10%, then 
blitting it will make only 90% of the background image remain. Doing it again 
will make only 90% of the already degraded background image remain -- so the 
remaining portion of the background image is 90% * 90% = 81%. After 10 
passes, 0.9**10 = 34.8% of the background image still remain.

[]s,

- -- 
Fábio "ctg \pi" Dias Moreira
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/ROMualOQFrvzGQoRApCMAJ9LvpklI/mWAXXWPq1Ni2dSw0JWHQCfc9lI
wr0tTjHpGiDj/eX1IAeHFSw=
=wvoY
-----END PGP SIGNATURE-----