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

Re: [pygame] Lossless Graphic File Formats



Kris Schnee wrote:
By the way, I'm wondering about saving images in a lossless way, preserving the exact color values of each pixel. Looks like the BMP format does that, but JPG and TGA don't, and while PNG apparently does, it's not supported in Pygame unless maybe I install PIL and some additional module. Any advice on this? Ideally I'd be able to save images in a common Web browser-readable format; PNG is probably good enough.

Kris



Though it will read PNG just fine, you're right, it won't save in PNG without PIL. What I have done is this: I try to import PIL. If it fails, I turn off the 'SaveAsPNG' switch. When taking screenshots, if SaveAsPNG is turned on, it will use PIL to save the screenshot; otherwise, it saves as BMP.


--Kamilche