public void ToBinary()
{
var filter = new Threshold(230); // create filter
filter.ApplyInPlace(Image); // apply the filter
Save("binarized");
/*
* Note: Since the filter can be applied as to 8 bpp and to 16 bpp images, the Threshold Value value
* should be set appropriately to the pixel format. In the case of 8 bpp images the threshold value
* is in the [0, 255] range, but in the case of 16 bpp images the threshold value is in the [0, 65535] range.
*/
}