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

[pygame] Image file formats with palettes



I'm trying to read images from a file, and use palette swapping/shifting.
So far the only format I can find that supports palettes is gif. I'm
creating images in MSPaint, which is limiting me to jpg, gif, bmp, tiff
and png. I'd _love_ to use png, but I can't get it to work without loading
a dummy gif and using convert().

My question is then: Is there a way to convert a surface to one with a
palette without resorting to gifs? I've tried stuff like:

img = pygame.Surface((40,40), HWPALETTE)

But it's not working. Which makes sense, I mean, I'm not identifying what
_kind_ of palette I'd like.

Thanks in advance!

---
Zak Arntson
www.harlekin-maus.com - Games - Lots of 'em