ValueError: unsupported colormasks for alpha reference array
I'm getting the following exception from pygame 1.9.1 when trying to use pixels_alpha():ValueError: unsupported colormasks for alpha reference array
The surface was created using Surface((w, h), SRCALPHA).
The masks it's using are: 00ff0000 0000ff00 000000ff ff000000
I can't see why this should cause it any problem. Anyone have any ideas?
(log in to comment)
neko on 2010/04/02 12:18:
I think you meant to use surfarray.pixels2d instead of surfarray.pixels_alpha. surfarray.pixels_alpha ONLY includes the alpha data, not the full ARGB data. Demonstration:$ cat tmp.py
import pygame
pygame.init()
surface = pygame.Surface((2,2), pygame.SRCALPHA)
surface.fill((0,56,0))
print pygame.surfarray.pixels_alpha(surface)
print pygame.surfarray.pixels2d(surface)
$ python tmp.py
[[255 255]
[255 255]]
[[4278204416 4278204416]
[4278204416 4278204416]]