You need first to load the image and then, accessing every single pixel, change it to either black or white RGB values, depending on its current color.
An example on how to perform pixel access (modification included) is in the
LockBits[
^]
LockBits
method documentation.
A
naive col_to_bw
method could be:
void col_to_bw( ref byte r, ref byte g, ref byte b )
{
if ( r*r + g*g + b*b >= 48387)
{
r = g = b = 255;
}
else
{
r = g = b = 0;
}
}
of course you could do better.