Re: displaying Image with colors [message #35351] |
Fri, 06 June 2003 17:38 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Robinson (robinson@model.iag.usp.br) writes:
> I am trying to display an image with colors where pixels with
> values from -10 to 20 have to be green, from 21 to 40 have to
> be orange, from 41 to 60 blue and values from 61 to 80 yellow.
> How could I do this?? Does somebody could help me?.
I would try something like this:
s = Size(image, /Dimensions)
cimage = BytArr(s[0], s[1])
TVLCT, FSC_Color('green', 'orange', 'blue', 'yellow'], /Triple), 100
I = Where(image GE -10 AND image LE 20, count)
IF count GT 0 THEN cimage[I] = 100
I = Where(image GE 21 AND image LE 40, count)
IF count GT 0 THEN cimage[I] = 101
I = Where(image GE 41 AND image LE 60, count)
IF count GT 0 THEN cimage[I] = 101
I = Where(image GE 61 AND image LE 80, count)
IF count GT 0 THEN cimage[I] = 102
Device, Decomposed=0
TV, cimage
Cheers,
David
P.S. You can find FSC_Color here:
http://www.dfanning.com/programs/fsc_color.pro
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|