Pull requests

#5 Merged
Repository
novalis_dt novalis_dt
Branch
default
Repository
pygame pygame
Branch
default

Add support for premultiplied alpha, necessary for integration with Cairo.

Author
  1. novalis_dt
Reviewers
Description

There's a fascinating article on the Pygame site about how to combine Pygame and Cairo: http://www.pygame.org/wiki/CairoPygame

Unfortunately, Cairo uses premultiplied alpha, and Pygame uses non-premultiplied. This means that if I generate an surface with 0 < alpha < 1 with Cairo, I can't correctly blit it to a pygame surface, because I will get dark edges.

This patch corrects this problem by providing a new blitting mode intended for this case. I think it could also be more generally useful, as described in http://home.comcast.net/~tom_forsyth/blog.wiki.html#%5B%5BPremultiplied%20alpha%5D%5D

  • Learn about pull requests

Comments (1)