Core Optical, Inc.
SpectrumColorScheme ClassIndustrial Strength, Scientific Grade
A type encapsulating the spectrum (rainbow) pseudocoloring scheme.
Inheritance Hierarchy

OnlineSystem Object
  PrecisionImage.Visualization SpectrumColorScheme

Namespace: PrecisionImage.Visualization
Assembly: PrecisionImage (in PrecisionImage.dll) Version: (

public class SpectrumColorScheme

This pseudocoloring scheme is the traditional "rainbow" type that progresses through an ordered spectrum via the ROYGBIV path (Red-Orange-Yellow-Green-Blue-Indigo-Violet, large to small values respectively). This pseudocoloring scheme is heavily used and is included in PrecisionImage.NET for completeness. However, it is considered a poor coloring scheme for data depiction as it exhibits large areas of isoluminosity. In addition, the hue progression is not linear. For these reasons this color scheme is not recomended. More modern pseudocoloring algorithms that take into account the physiology of human color vision (LinearPerceptionColorScheme / ConstantSaturationColorScheme / VariableSaturationColorScheme) should be considered over the SpectrumColorScheme.


The following example illustrates the use of the SpectrumColorScheme class.

using PrecisionImage;
using PrecisionImage.Visualization;
using PrecisionImage.BinarizationAndMorphology;

// Load the image: 
Uri imageUri                   = new Uri("HorseStatueXray.tif", UriKind.Relative);
TiffBitmapDecoder imageDecoder = new TiffBitmapDecoder(imageUri, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
BitmapSource SourceImage       = imageDecoder.Frames[0];
image0.Source                  = SourceImage; // Display x-ray 

// Load x-ray data into SourceData object: 
SourceData xrayData = new SourceData(SourceImage, GammaEncoding.None);

// Instantiate a binary mask to force processing to bypass null-signal areas. Original image 
// is 16-bit, filter out values below 4500 level:
Mask = new BinaryMask(SourceImage, 4500, true);

// Instantiate a spectrum pseudocoloring scheme object: 
SpectrumColorScheme colorScheme = new SpectrumColorScheme();

// Retrieve the pseudocolored image and display result using the binary mask to screen out null-signal areas:
image1.Source = colorScheme.GetPseudocolorImage(xrayData, 0, ColorBitDepth.EightBit, binaryMask: Mask);

The above example generates the following images:

See Also