From: Peter.Averkamp@e20.physik.tu-muenchen.de (Peter Averkamp)
Newsgroups: comp.soft-sys.khoros
Subject: Re: colormaps?
Date: 11 Jan 93 12:05:09 GMT

On Jan 8, 23:11, John C. Schultz wrote:
{ Subject: colormaps?
> Basically I do not understand how colormaps should/can be used.  For a
> single band image is it valid to think of them as a lookup table?
Yes.

> What is used if the colormap is OPTIONAL?  For example the kitten
> image distributed with Khoros looks the same on an 8 bit SPARC display
> whether I use the colormap or not.   Why?
> 
Because the map type of the kitten image is of type FORCE. This, as the
name implies, forces the use of the map.  If a viff file specifies the
map(s) as OPTIONAL, the application is free to either use it or not;
putimage, e.g. has a control flag '-use_cmap {t/f}' that controls this
behaviour. In the case of FORCEd maps, this is meaningless.

> These questions are driven by my desire to include the histogram of
> the image as part of a VIFF image.  One technique which comes to mind is
> to incorporate the histogram as a color map but I am not sure what the
> effect will be.
> 
> I also wanted to use a color map to display the relevant portion of
> an image so each of my images would have two (optional) colormaps.
> 
> Taking an example of what I want to do.
> - ----------------------------------------------------------------------
> My 16 bit image has actual data in the gray level region from pixel
> value = 10,000 to 12,000. I can make a color map that linearly
> maps this [10K,12K] gray level region to 8 bit data for display.  Do I
> lose the original data?
Depends. If you apply this map for display only, no. There is of
course a loss of data on the display as 2000 different colours/gray levels
cannot be displayed on a 8 bit display, but your data remain unchanged.
If you attach a map to your data and then process it, yes. Mapping data
completely changes their meaning from data to pointers into a table. Even
the data storage type can be changed this way from e.g. shorts to floats.

> Can I do this mapping? Waht data does
> EDITIMAGE see - the 8 bit or the 16 bit? 
Editimage gets the 16bit data but maps them according to the map. So the
data you interactively work with is the result from the mapping process(8bit).

> What happens if I use
> the second map (which must be of type LONG or FLOAT) to store the
> histogram? I only want 8 bits of data for the display but the "other"
> colormap (which is actually a histogram) must be at least 4 bytes/entry.
You cannot have two different data storage types for maps in a single
viff file. As the Histogram is not really a map anyway, i'd suggest writing
it into another file.

> 
> Thanks.
> - --
>    John C. Schultz   +1 (612) 733-4047   schultz@halley.serc.3m.com
>    How to include the taste of Glendronach in a multi-media system?
}-- End of excerpt from John C. Schultz


Hope this helps,

 Peter Averkamp


-- 
Peter Averkamp,                      | email:
Physics Department E20               | petav@radon.e20.physik.tu-muenchen.de
Techn. Univ. of Munich               | Phone: ++49 (89) 3209-2408 and -2814
D-8046 Garching, Germany             | Fax:   ++49 (89) 3209-2338