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

Home » Public Forums » archive » color mapping question
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: color mapping question [message #6809 is a reply to message #6806] Thu, 29 August 1996 00:00 Go to previous messageGo to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Scott Gennari wrote:
> I have a 256 color grayscale image and i'd like to overlay a
> coastline with some color (red). How would I strech the grayscale
> data values to fit 0-254 and reserve value 255 for a certain rgb
> color? I'm Not having much luck with STRETCH,0,254 and then assigning
> a rgb color to 255.

Try something this:

;- load grey scale color table

loadct,0

;- display image scaled to full color range, leaving one color
;- free at top of lookup table

tv,bytscl(dist(256),top=!d.n_colors-2)

;- make top color in lookup table red

tvlct,r,g,b,/get
g(!d.n_colors-1)=0
b(!d.n_colors-1)=0
tvlct,r,g,b

;- overplot a line in red

plots,[0,0],[200,200],color=!d.n_colors,/device

Cheers,
Liam.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Color Bars
Next Topic: IDL: TIFF functions

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

Current Time: Fri Oct 10 14:27:40 PDT 2025

Total time taken to generate the page: 0.96119 seconds