comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Creating Transparent PNG Images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Creating Transparent PNG Images [message #68444 is a reply to message #68443] Sat, 24 October 2009 05:33 Go to previous messageGo to previous message
devin.white is currently offline  devin.white
Messages: 50
Registered: March 2007
Member
You can write out transparent 24-bit PNGs by supplying a 4-channel
array to WRITE_PNG (4 x samples x lines). The first three channels
are RGB, the fourth is the alpha channel. Fully visible pixels should
have their corresponding alpha channel elements set to 255,
transparent pixels should have theirs set to 0.


On Oct 23, 2:53 pm, David Fanning <n...@dfanning.com> wrote:
> 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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Wow! Value_Locate
Next Topic: For loop

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:29:16 PDT 2025

Total time taken to generate the page: 0.00427 seconds