How to convert a photo to a black and white image by ImageMagick?

According to this forum post:

However, if you want two colors only (black and white), then you need to threshold. For example, to select the color where above will be white and below will be black.

convert <input> -threshold xx% <output>

where xx is in range 0-100 (for percent).


Dithering is clearer and more fax-like than a threshold cutoff:

convert <input> -monochrome <output>

For a less contrasty but more information-preserving kind of dithering, use:

convert <input> -remap pattern:gray50 <output>

(Docs)


According to this answer here:

If you have imagemagick installed:

true grayscale only:

convert source.jpg -colorspace Gray destination.jpg

true black and white:

convert source.jpg -monochrome destination.jpg

separate into gray channels:

convert source.jpg -separate destination.jpg