Home »
Public Forums »
archive »
color mapping question
Re: color mapping question [message #6946 is a reply to message #6806] |
Thu, 29 August 1996 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Christian Soeller wrote:
>
> gennari@universe.Hawaii.edu (Scott Gennari) writes:
>
>> 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.
>
> Even on a 256 color display IDL will in general only have a subset of all
> those colors as a few are normally already allocated by other applications.
> The actual number of colors available to IDl can be found in the sys var
> !D.TABLE_SIZE. So you might try to scale your data to 0...!D.TABLE_SIZE-2
> and assign the color number !D.TABLE_SIZE-1 to red (colors 0...!D.TABLE_SIZE-2
> set to shades of grey from 0 to 255). You get the idea. See also documentation
> for the TVSCL procedure.
I use the following routines I've written to do this. If any look
useful to you let me know and I'll mail them to you.
BYTE_SCALE.PRO : scale contents of array between specified upper
and lower bounds
GRAYSCALE.PRO : Small popup widget with sliders to allow grayscale
adjustments. Can specify reserved colors.
ADJUST_PALETTE.PRO : Adjust RGB values for individual color index.
ADJUST_COLORS.PRO : Widget that lets you interactively adjust the
colors for any color index.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
[ UCSD Mail Code 0949 ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|
Current Time: Wed Oct 08 19:25:51 PDT 2025
Total time taken to generate the page: 0.00374 seconds