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

Home » Public Forums » archive » Re: displaying Image with colors
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: displaying Image with colors [message #35351] Fri, 06 June 2003 17:38
David Fanning is currently offline  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
[Message index]
 
Read Message
Previous Topic: displaying Image with colors
Next Topic: mouse wheel event

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

Current Time: Sat Oct 11 12:35:35 PDT 2025

Total time taken to generate the page: 0.88477 seconds