Color composite

Algorithm

Standard color composites

Linear stretching of interval:

The specified interval range per band is linearly divided into 6 classes of equal length with numbers 0 to 5. Since this is done for three bands, the number of possible combinations is 6´6´6 = 216. This is the number of different colors that will appear in the color composite.

Histogram equalization:

The specified interval range (lower and upper boundary) per band is divided into 6 classes with numbers 0 to 5, in which each class has an equal area under the histogram. As for linear stretching, the number of different output colors is 6´6´6 = 216.

Output colors:

Each output color obtains an internal number of the system picture domain ColorCmp; the value is calculated as:

  

output = 36*red + 6*green + blue.

  

This implies that the output map will contain internal values between 0 and 215 (since 215 = 5 * 36 + 5 * 6 + 5). The values of this ColorCmp domain are always linked to system representation ColorCmp.

Dynamic color composites

A dynamic color composite is calculated using the Heckbert Quantization Algorithm. The Heckbert algorithm produces a color composite on the basis of the amount of variation in pixel values in the three input maps.

This algorithm first builds a three dimensional histogram, indicating how 'popular' any given value is in the images. All values fall in one box or cube. This histogram is then subdivided into smaller boxes or cubes: a division is made in the middle of the axis which has the largest variation. This process continues until as many boxes are created as there are output colors (number defined by the user, maximum 255). This algorithm attempts to create boxes which have approximately equal popularity in the image. Then, colors are assigned to represent each box.

  

  1. First, the input map values at 1% and 99% are determined. See also the Histogram operation.
  2. The band with the largest variation in pixel values is selected, the total number of pixels for this band is calculated, and the band is divided into 2 halves, each containing half of the total number of pixels. The division leaves the other 2 bands intact. The result after one division is 2 so-called 'boxes': one band divided over the 2 boxes, and the other 2 bands complete in both boxes.
  3. The program then searches for the next (part of a) band with the largest variation in pixel values. The total number of pixels on that (part of the) band is calculated, the (part of a) band is divided into 2 halves, so that each new part of the band contains half of the total number of pixels, and the other 2 bands are left as they were. The result after 2 divisions is 3 'boxes': each with (parts of) the red, the green, and the blue band.
  4. The division process is repeated until the total number of 'boxes' reaches the number of user-defined colors desired for the output map.
  5. Then colors are assigned to all boxes. For each box, weighted averages are calculated of the parts of the red band, green band and blue band covered by that box; the outcome values are the Red, Green and Blue values for that box. The calculation is repeated for all boxes.

An example of the first and second division is given in Figures 1, 2 and 3 below.

Example Heckbert algorithm:

Three 1% histograms are calculated before the first division, see Figure 1:

  

Figure1:

Figure 1 shows that the pixel values range:

Thus, the largest variation is found in the second input map. The total number of pixels on this band is divided in 2 so-called 'boxes': the first division is at pixel value 65 of band 2.

The result of the first division is represented in Figures 2 and 3. Figure 2 shows the histograms of one box; Figure 3 the histograms of the other. Enlarge the Help window by dragging its borders when you cannot see both figures next to each other.

  

Figure 2:

Figure 3:

Figure 2 shows that the pixel values range in box 1:

Figure 3 shows that the pixel values range in box 2:

The next largest variation is found in the first input map in box 1. The total number of pixels on this band divided into 2 parts: the next division takes place at pixel value 66.

Output domain for dynamic composites:

The operation creates a new domain (type Picture) for the output color composite and a new representation for this domain. This output domain and representation are always stored by the output map (internal domain and internal representation).

24-bit RGB color composites

Linear stretching of interval:

Each input band is stretched to values between 0 and 255 using linear stretching using the user-defined intervals of the histograms.

Histogram equalization:

Each input band is stretched to values between 0 and 255 using histogram equalization using the user-defined intervals of the histograms.

Output colors:

The results are combined in a map with 4 bytes per pixel (4 bytes is 32 bits, thus 8 bits are not used). Each pixel in this map contains the red, green, and blue intensities of values between 0 and 255. It means that the possible number of output colors is 256 x 256 x 256 = ± 16 million.

24-bit HSI color composites

In this case no stretching is performed. In the output map, for each pixel the hue, saturation and intensity is converted to red, green, and blue intensities. The following relations exist:

  

Hue

=

255/2p * arctan2 ( 1/2 * Ö3 * (Green-Blue) , Red - (Green+Blue) / 2 ) * 240/255

Saturation

=

Ö (Red2 + Green2 + Blue2 - Red*Green - Red*Blue - Green*Blue) * 240/255

Intensity

=

1/3 * (Red + Green + Blue) * 240/255

Red, green, and blue values range from 0 to 255. Hue, saturation, and intensity values however range from 0 to 240; this range complies with the Windows color scheme definition. In the formulas above, multiplication factor 240/255 is used to obtain that range.

References:

Heckbert, P., 1982. Color image quantization for frame buffer display. SIGGRAPH '82 Proceedings, p. 297.

See also: