Core Optical, Inc.
BlackBodyColorScheme ClassIndustrial Strength, Scientific Grade
A type encapsulating the "Black-Body" pseudocoloring scheme.
Inheritance Hierarchy

OnlineSystem Object
  PrecisionImage.Visualization BlackBodyColorScheme

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

public class BlackBodyColorScheme

This is a pseudocoloring scheme wherein the luminance of the output colors increases monotonically. The name "Black-Body" refers to the algorithm's attempt to approximate the color progression of a black-body emitter. Colors that are associated with small data values are very low luminance (dark) and progress through red, yellow and finally white for the largest values.

As the name suggests, this coloring scheme is useful when depicting data values associated with - but not limited to - thermal imagery. While the rainbow coloring scheme is traditional used for this purpose (see SpectrumColorScheme) it suffers from large areas of isoluminance that can confuse interpretation and magnitude estimation of the underlying data. The BlackBodyColorScheme algorithm exhibits greater linearity in terms of luminance progression.


The following example illustrates the use of the BlackBodyColorScheme class.

using PrecisionImage;
using PrecisionImage.HistogramProcessing;
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);

// Apply an adaptive histogram equalization in-place to the original x-ray image: 
HistogramProcessor histProcessor = new HistogramProcessor();
histProcessor.AdaptivelyEqualizeHistogramInPlace(xrayData, 0, 60, 0.002f, binaryMask: Mask);

// Instantiate a new BlackBodyColorScheme object to generate the pseudocolored image: 
BlackBodyColorScheme colorScheme = new BlackBodyColorScheme();

// Retrieve a pseudocolored image of the source data and display the 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