Semi-Transparent Images [message #81841] |
Tue, 23 October 2012 21:40 |
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.")
|
|
|