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 #35361 is a reply to message #35296] Thu, 05 June 2003 12:43 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:

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

did you have tried with 24bit or 16bit color resolution.
I believe you have 16bit used.

If it's 16bit then it is the same problem JD postest on 22.5.
I added an other example there.

I recognized this during beta test of idl5.6.

Reimar



--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
[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: Wed Oct 08 20:10:30 PDT 2025

Total time taken to generate the page: 0.03655 seconds