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

Home » Public Forums » archive » Re: R,G,B 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
Re: R,G,B image [message #10514 is a reply to message #10513] Tue, 09 December 1997 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Luis M. Gonzalez (lmgc@gmv.es) writes:

> I have a bi-dimensional image as a three R,G,B vectors.
> Is it possible to display it directly within IDL? Or should we
> convert each RGB triple into an index to the color table?.

Here is what I would do. Suppose your vectors (r, g, b) describe
a 400 by 300 image.

; Create a 24-bit pixel interleaved image.

image24 = BytArr(3, 400, 300)
image24[0,*,*] = Reform(r, 400, 300)
image24[1,*,*] = Reform(g, 400, 300)
image24[2,*,*] = Reform(b, 400, 300)

; Display the 24-bit image directly in IDL.

TV, image24, True=1

The last command would tie your image to the color table
indices. That is, the image values would be run through
the color tables when they are displayed to select the
display color. You may prefer to see the "true" color.

If you are on an 8-bit system (I presume you are from your
color table question), then you may want to do this:

trueColorImage = Color_Quan(image24, 1, red, green, blue)
TVLCT, red, green, blue
TV, trueColorImage

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: IDL Emacs Modes Kidnapped
Next Topic: R,G,B image

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

Current Time: Wed Oct 08 19:21:49 PDT 2025

Total time taken to generate the page: 0.00386 seconds