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

[pygame] image conversion in memory



Hi all!

Is there a way to convert a pygame surface to a png or jpeg IN MEMORY instead of saving to disk and loading again?
something like
get_screen = SCREEN.subsurface(0, 0, SCREENW, SCREENH) # grab the screen

my_image = get_screen.convert(jpeg) # now convert the image to jpeg

and now my_image is a jpeg image of get_screen

I searched the net but couldn't find any other way other than save to disk as jpeg and reload.

Any positive OR negative help is very much appreciated.

Thanks in advance
Diliup Gabadamudalige

http://www.diliupg.com
http://soft.diliupg.com/

**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are not the intended recipient or have received it in error, please delete it and all copies from your system and notify the sender immediately by return e-mail. Any unauthorized reading, reproducing, printing or further dissemination of this e-mail or its contents is strictly prohibited and may be unlawful. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions.
**********************************************************************************************