PhilipBober wrote:
> I'm trying to save a screenshot of my program, and I don't want it to
> include the alpha channel (This makes it appear different from what my
> program looks like when running)
> I'm currently using:
>
> image.get_buffer_manager().get_color_buffer().save('out.png')
>
> but it saves the alpha channel. I tried switching it to .BMP (since
> that format doesn't support an alpha channel) but pyglet refuses to
> write a BMP from RGBA data.
>
Unless you have PIL, pyglet won't write BMP at all (If you have PIL,
that's what's complaining, not pyglet).
> How can I easily drop the alpha channel from the image? I've tried
> several things with the image classes but I can't seem to figure this
> out.
>
Use the ImageData class to reformat the image. Something like (untested)::
img = image.get_buffer_manager().get_color_buffer().image_data
img.format = 'RGB'
img.save('out.png')
Alex.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---