# Bin Mode

A Histogram tool allows you to specify how many bins the tool uses to represent grey values in the image. For example, by default an 8-bit greyscale image uses 256 bins to represent grey values from 0 to 255.

Use the NumBins parameter with the BinMode property to specify how bin processing should be performed. The BinMode property supports the following options:

- Auto: By default the tool ignores any value set for NumBins and calculates a histogram with the full dynamic range of the current input image:
  - 256 bins for 8-bit greyscale images
  - 65,536 bins for 16-bit greyscale images

- Uniform: Compute a histogram with the number of bins set to NumBins, each of which corresponds to an approximately equal sized number of possible greyscale values spread uniformly across the entire dynamic range of the current input image.

  For example, setting NumBins to 64 (256/4) with an 8-bit greyscale image forces the Histogram tool to count pixels with grey values 0,1,2, or 3 in the first bin.

- Compatability: Compute a histogram with the number of bins set to NumBins. Any observed pixel with a greyscale value equal to or greater than the value of NumBins will cause the count in the last bin (NumBins - 1) to be incremented.

  For example, setting NumBins to 100 with an 8-bit greyscale image forces the tool to increment bin 99 for any pixel with a greyscale value equal to or greater than 99.