Converting from color to true black and white in ImageMagick? [duplicate]

I have seen how to convert a picture from color to grayscale in this Super User question and answer thread. However, grayscale is not black and white.

Simply put, if a field has color, I want to convert it to black. All other areas should be white. So, if a line 6 pixels thick is orange, the other thread's answer will turn the line gray. The line should be turned solid black.

However, is there a way to convert anything of any color at all (not white) to black?

I am working with Engineering prints, and it simply needs to be black or white. Gray does not work, because certain color lines become “gray” lines.


How do I convert from color to true black and white?

If a field has color, I want to convert it to black.

Use the following command:

convert <input> -negate -threshold 0 -negate <output>

Threshold Dithering Methods

Threshold Images

The simplest method of converting an image into black and white bitmap (to color) image is to use -threshold. This is actually a simple mathematical operator that just provides a cut-off value. Anything equal to or below that value becomes black, while anything larger becomes white.

...

If you actually want to convert all non-pure white colors to black, then I recommend that you threshold the negated image instead of trying to work out the right threshold value to use (one less than IM's current 'MaxRGB'), a value that is dependant on your specific IM's compile time in Quality, or 'Q' setting.

convert logo.png -negate -threshold 0 -negate threshold_white.gif

Source Threshold Dithering Methods