Appendix 4: Color Composites

There are three methods of creating color composites from multispectral images using xv. Two methods generate optimal colors for the image being displayed. The disadvantages of these methods are they are slow, and only one image can be displayed in optimum colors at once. A third method uses the same colormap for all color images. The images created by this method are less optimal, but usually adequate. In addition, any number of images may be displayed at once using this method.

These algorithms work best when the images are contrast stretched prior to displaying, so that they use the full range of 0 - 255. The images may be stretched with xv. and saved as IPW images (named band#.s.ipw in the following examples). Alternatively, a histogram equalization may be performed using histeq.

% foreach i (3 2 1)

? hist $i.ipw | histeq | lutx -i $i.ipw > $i.s.ipw

? end

By default, xv. uses one of the optimal color algorithms. The following command uses this algorithm to generates a a `true color' simulation of the Austria image:

% mux {3,2,1}.s.ipw | xv

The other optimal color algorithm, which is much slower, but produces better results for some images, is accessed by the following command:

% mux {3,2,1}.s.ipw | xv -best

The following command uses generates a color image using a default colormap:

% mux {3,2,1}.s.ipw | xv -quick

IPW does not support an 8-bit color image format. Therefore, once created, these images cannot be saved with xv. as an IPW image. However, they may be saved in another format, such as 'gif'. Since further IPW processing is not relevant on 8-bit color images, this is not usually a problem. However, it is necessary to save an 8-bit color image as an IPW image in order scribe an area of interest on a color image. The IPW program rgbmux can be used to create and save color composties which use the same color map for all images. rgbmux uses the same algorithm used by the `quick' method in xv, but it uses a slightly different colormap.

% mux {3,2,1}.s.ipw | rgbmux > 321.col

This image may then be displayed using xv.

% xv 321.col

With xv 3.10 it is possible to save color images in IPW format. These color images are 3 bands, but they have gone through the xv 24 - 8 bit coloring algorithm, and are not the same as the original image.

Flowchart 5 shows a schematic representation of this procedure.