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

Home » Public Forums » archive » transparent background
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: transparent background [message #35364 is a reply to message #35296] Thu, 05 June 2003 12:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rick Towler (rtowler@u.washington.edu) writes:

> You didn't really fool around for 20 minutes, did you?

Indeed I did. I thought it might take five. And now
I've just spent another 15. :-)

> With the B/W linear color table loaded:
>
> IDL> test = BYTARR(200,200)
> IDL> test[100:199,*] = 200
> IDL> tvlct, r,g,b,/get
> IDL> write_png,'test.png',test,r,g,b,TRANSPARENT=[0]
>
>
> In PP, Insert -> Picture -> From File... and select 'test.png'
>
> I have a 200x200 image, right half is lt. gray, left half is transparent.
>
> Load test.png up in Photoshop and the left half of the image is transparent
> too.

Well, I can see this works. But why doesn't my test
program work?

PRO TEST
thisDev = !D.Name
white = FSC_Color('white', !D.Table_Size-2, Decomposed=0)
red = FSC_Color('red', !D.Table_Size-3, Decomposed=0)
green = FSC_Color('green', !D.Table_Size-4, Decomposed=0)
Set_Plot, 'Z', /Copy
Erase
Plot, findgen(11), Color=red, Background=white, /NoData
Oplot, findgen(11), Color=green
snapshot = TVRD()
tvlct, r,g,b,/get
Set_Plot, thisDev
write_png,'tester.png',snapshot,r,g,b,TRANSPARENT=[!D.Table_ Size-2]
Print, !D.Table_Size-2
I = Where(snapshot EQ !D.Table_Size-2, count) & Print, count
END

My background (index 254) is white. I want that to be the transparent
pixel value. There are 304,055 pixels in my image with this value.
You'd think a *few* of them would be transparent. But no, when
I put this into Powerpoint, I get an image with a white background.

Any ideas?

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TVRD, Decomposed = ? and 24bit display
Next Topic: M-SSA

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

Current Time: Fri Oct 10 10:48:06 PDT 2025

Total time taken to generate the page: 0.47689 seconds