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

Home » Public Forums » archive » Color Overlays on Gray-Scale Image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Color Overlays on Gray-Scale Image [message #14925] Tue, 30 March 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Folks,

I mentioned a few days ago that I had fooled around with
the alpha blending channel on object graphics images to
see if I could create color image overlays on top of
gray-scale images. This worked extremely well, once
I realized that the foreground image had to be a 24-bit
image. (The background image can be a 24-bit image or
an 8-bit image.)

I'm in the process of writing an article about this for
my web page, but I thought the folks here might like a
preview of the code itself. (I'm trying to debug the
darn thing, if you want to know the truth.) The program
is named IMAGE_BLEND.PRO and it can be found at this URL:

http://www.dfanning.com/programs/image_blend.pro

You can just type it's name to see it in action:

IDL> Image_Blend

Or, you can pass it your own images (2D images only).
The images can be different sizes if you like:

IDL> Image_Blend, backgroundImage, foregroundImage

A COLORTABLE keyword can be used to set the colors
associated with the foreground image. The Red Temperature
color table (3) is used by default:

IDL> Image_Blend, Colortable=5

I wrote the program so that you can change either the
foreground or background image colors. (And at the same
time, if you like. Try *that* with XLOADCT!) But you
will need my color changing tool XCOLORS:

http://www.dfanning.com/programs/xcolors.pro

There is also a slider that will allow you to change
the "amount" of transparency of the foreground image.
All pixel values greater than zero are set with this
value. All zero pixel values are totally transparent.
(They don't have to be, but the example images look
better this way.) In a real application you would
probably make bone values less transparent than
muscle values, etc.

I tested the program briefly on an 8-bit display. It
"works", but like all object graphics programs it looks
a hell of a lot better on a 24-bit display and, of course,
there are no color conflicts on a 24-bit display.

There seems to be a bug in the Macintosh version of
IDL 5.2 on MacOS 8.x in which my XColors program
can go into some kind of a loop by sending an event
to another widget program. I'm investigating with RSI.
I could show you how to workaround this if it is
important to you.

Let me know what you think. This is not the be-all and
end-all. But it gets us going down the right path,
I think. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@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
Previous Topic: Widget_Message on the Mac
Next Topic: Site addition ideas (Re: ids-pvwave archive)

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

Current Time: Fri Oct 10 15:24:18 PDT 2025

Total time taken to generate the page: 0.32159 seconds