By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

png transparency with PIL

P: n/a
I'm trying to determine the transparency information for a png image. With gif
images I can determine the colour that is used for transparent areas using
im.info['transparency']. For the png images of interest there is no such entry
in the info dict. I assume that's because of the way png does transparency. I'm
guessing I need the alpha channel, but is there a way to get hold of it?
--
Robin Becker

Nov 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Robin Becker wrote:
I'm trying to determine the transparency information for a png
image. With gif images I can determine the colour that is used for
transparent areas using im.info['transparency']. For the png
images of interest there is no such entry in the info dict. I
assume that's because of the way png does transparency. I'm
guessing I need the alpha channel, but is there a way to get hold
of it?
For accessing the alpha channel, there is an RGBA mode for PNG
files:

http://www.pythonware.com/library/pi...format-png.htm

Regards,
Björn

--
BOFH excuse #58:

high pressure system failure

Nov 23 '07 #2

P: n/a
Bjoern Schliessmann wrote:
Robin Becker wrote:
>I'm trying to determine the transparency information for a png
..........
>guessing I need the alpha channel, but is there a way to get hold
of it?

For accessing the alpha channel, there is an RGBA mode for PNG
files:

http://www.pythonware.com/library/pi...format-png.htm
........

that sounds like what I need.
--
Robin Becker
Nov 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.