how to know if an image data is ABGR or RGBA from pygame?

Viewed 161

When I load png files with pygame.image.load and then get data with pygame.surfarray.pixels2d, I get sometimes color data in ABGR format, and sometimes in RGBA, forcing me to a conversion if copy data from one type to another.

Problem is that I can't foresee if data will be ABGR or RGBA, and I comment or uncomment the conversion when I'm working on another file.

Is there a way to know data type from pygame ?

1 Answers
Related