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

Home » Public Forums » archive » Re: Color table 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 table question [message #433 is a reply to message #427] Tue, 11 August 1992 03:13 Go to previous message
hofer is currently offline  hofer
Messages: 16
Registered: April 1991
Junior Member
In article <1992Aug10.223854.14071@news2.cis.umn.edu>,
patel@sparky.drad.umn.edu writes:
> In PV-WAVW, I need to display a gray scale image(256 grays). I need
> few colors for graphics. I did the following to accomplish this:
>
>
> loadct,0 ; load a gray scale color table.
> ; Load the color table with 7 colors.
> Tvlct, 140, 140, 140, 1
> Tvlct, 130, 140, 220, 2
> Tvlct, 90, 80, 160, 3
> Tvlct, 255, 255, 255, 4
> Tvlct, 200, 200, 60, 5
> Tvlct, 50, 170, 80, 6
> Tvlct, 200, 70, 70, 7
>
> ; Byte scale the image in 'im'
> imb=bytscl(im)
> ;to avoid funny colors in the image, set all pixels with value <10 to 10
> imb(where(imb lt 10))=10
> tvscl,imb
> end
>
>
> with this segment of the program, I donot expect to see any colors
> in my image. But I do see scattered pixels with different colors.
> What am I doing wrong here.
> Thanks for your help.
>
> Maqbool Patel
> patel@hippy.drad.umn.edu

Use `tv' instead of `tvscl' to plot the image. `tvscl' scales the image into
the range 0..255, so all pixels with the value 10 in `imb' will become 0.
BTW, wouldn't it be more sensible to scale your data linear between 10 and 255
instead of setting all values <10 to 10. So I would use:

; Byte scale the image in 'im' to the range 10..255
imb = bytscl(im, TOP=245) + 10B
; dump the image to the screen
tv, imb

Hope this helps.

Remo Hofer
--
RFC822: <hofer@urz.unibas.ch> or <hofer%urz.unibas.ch@CERNVAX.BITNET>
X.400: S=hofer;OU=urz;O=unibas;P=SWITCH;A=ARCOM;C=CH
HEPNET/SPAN: CHGATE::YOGI::HOFER or 20579::48130::HOFER
[Message index]
 
Read Message
Read Message
Previous Topic: Re: IDL/PVWAVE History
Next Topic: /NORM with OPLOT and other thoughts

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

Current Time: Thu Oct 09 21:46:35 PDT 2025

Total time taken to generate the page: 0.32572 seconds