Creating Transparent PNG Images [message #68451] |
Fri, 23 October 2009 11:53 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I have a question about transparent PNG images. If you
go somewhere on the Internet and look for a transparent
PNG image, you will typically download an image that
has a "4" in one of its dimensions. One could think
of this as a "typical" 24-bit or true-color image with
an extra alpha channel. In IDL you have to go to some
effort to display such an image correctly:
http://www.dfanning.com/ip_tips/transparentpng.html
Now, for reasons that are obscure and don't have much
to do with IDL, I need to create such a PNG image from
within a piece of IDL code. Unfortunately, it doesn't
look like WRITE_PNG is up to the job.
I can easily create a 24-bit true-color image. But this
doesn't allow me to use the TRANSPARENT keyword. The only
way to make a transparent PNG is to have an 8-bit byte
image and RGB color vectors.
Am I missing something here in the documentation? Or, if
not, does anyone have a favorite method for creating
a true-color PNG file with an alpha channel? (I am
afraid this is a firm requirement for downstream
software to work correctly.)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|