Represents a bitmap histogram.
Namespace:
Aurigma.GraphicsMill
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public sealed class Histogram : IDisposable
Histograms are widely used in imaging. It is represented as an array which contains values specifying as much items as intensity levels are supported by a bitmap (i.e. for 8 bit per channel bitmaps it will be 256, for 16 bit per channel - 65356). Each histogram entry stores a number of bitmap pixels which have the same intensity level as index of this entry. For example, the first histogram entry contains a number of black pixels (i.e. pixels having zero intensity level). Entry at index 192 contains a number of pixels with intensity level equal to 192.
When Graphics Mill builds a histogram for a grayscale bitmap, it uses pixel value as an intensity level. For color bitmaps (RGB, CMYK) several algorithms for calculating intensity level of each pixel are available. Graphics Mill implements two of them:
Histogram enables you to estimate image contrast programmatically. Also you can get some other characteristics (mean brightness, standard deviation, median, etc).
Histogram is used (explicitly or implicitly) in a number of Graphics Mill transforms, such as HistogramEqualize, Levels, BrightnessContrast (in automatic mode), etc.
var histogram = bitmap.Statistics.GetSumHistogram(); for (int i = 0; i < histogram.Length; i++) { Console.WriteLine(i + ": " + histogram[i]); }