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

Home » Public Forums » archive » Semi-Transparent Images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Semi-Transparent Images [message #81841] Tue, 23 October 2012 21:40
David is currently offline  David
Messages: 24
Registered: April 1997
Junior Member
Folks,

While fooling around with the TRANSPARENT keyword to cgImage
the other day, I realized how little I knew about transparent
images when I first wrote Make_Transparent_Image. So, I decided
I would retire that program and create a new program named
cgTransparentImage with the functionality that the earlier
program should have had, if I had known what I was doing.

So, there is a new program, cgTransparentImage, that can
make a semi-transparent image out of any 2D or true-color image.
Also, you can specify a "color" or "missing value" that
is completely transparent. Optionally, you can save
this image that is created as a transparent PNG file.

Essentially, then you have two ways of creating transparent
images. You can do it directly with cgImage, like this:

cgImage, cgDemoData(7), CTIndex=0
cgImage, cgDemoData(5), Transparent=50, Missing_Value=0, CTIndex=22

Or, you can do it like this:

timage = cgTransparentImage(cgDemoData(5), Transparent=50, $
Missing_Value=0, CTIndex=22)
cgImage, cgDemoData(7), CTIndex=0
cgImage, timage

You can find cgTransparentImage here:

http://www.idlcoyote.com/programs/cgtransparentimage.pro

You can find the documentation for the program here:

http://www.idlcoyote.com/idldoc/cg/cgtransparentimage.html


This should help, when an image is added to Google Earth, too,
since transparency is often a good thing there, too.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Simple question in IDL, looking for solution, thank you
Next Topic: Re: IDL New Graphics Axis function: bug or feature?

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

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

Total time taken to generate the page: 0.96109 seconds