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 #68443 is a reply to message #68442] Sat, 24 October 2009 07:59 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Devin White writes:

> 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.

OK, well, then the documentation REALLY needs to be improved!

But there is still a problem. Consider the transparent PNG
image you find here:

http://www.dfanning.com/ip_tips/example.png

I tried this:

IDL> image = read_png('example.png')
IDL> help, image
IMAGE BYTE = Array[4, 162, 150]
IDL> write_png, 'test.png', image

Then, I opened both example.png and test.png in my
browser (FireFox). They appear to be two different
images! The test.png file appears in MUCH darker colors.

Any ideas on what this could be about?

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: Thu Oct 09 23:35:49 PDT 2025

Total time taken to generate the page: 0.55684 seconds