title: Check if image is binary
body: <p>I tried to convert an image <code>jpg</code> file to binary image, I mean, only B&amp;W colors.</p>
  
  <p>I run <code>convert -monochromatic in.jpg out.jpg</code> and the result is visually satisfactory. </p>
  
  <p>Then I tried to check if the image really contains only B&amp;W colors. So I run <code>identify -verbose out.jpg</code> and the result was too long. </p>
  
  <p>But the main part I'd like to show here is the following:</p>
  
  <pre><code>  Type: Grayscale
    Colorspace: Gray
    Depth: 8-bit
    Channel depth:
      gray: 8-bit
    Channel statistics:
      Pixels: 3978000
      Gray:
        min: 0 (0)
        max: 255 (1)
        mean: 188.613 (0.739659)
        standard deviation: 111.739 (0.438194)
        kurtosis: -0.804836
        skewness: -1.0932
    Colors: 12
    Histogram:
      883301: (  0,  0,  0) #000000 gray(0)
      109638: (  1,  1,  1) #010101 gray(1)
       35348: (  2,  2,  2) #020202 gray(2)
        6126: (  3,  3,  3) #030303 gray(3)
         570: (  4,  4,  4) #040404 gray(4)
          30: (  5,  5,  5) #050505 gray(5)
          36: (250,250,250) #FAFAFA gray(250)
         980: (251,251,251) #FBFBFB gray(251)
       10689: (252,252,252) #FCFCFC gray(252)
       64396: (253,253,253) #FDFDFD gray(253)
      195093: (254,254,254) #FEFEFE gray(254)
     2671793: (255,255,255) #FFFFFF gray(255)
  </code></pre>
  
  <p>So what is strange to me is the <strong>Colors: 12</strong> line. Does it mean that the image is not B&amp;W? Should it be only 2?</p>
  
  <p><strong>Edit:</strong> based on answer below, the command should be <code>convert -threshold</code> and the important part from <code>identify</code> info is <em>Channel</em>.</p>
  
  <p>But even with this last option, I get 8-bit not 1-bit.</p>
  
  <pre><code>  Depth: 8-bit
    Channel depth:
      gray: 8-bit
  </code></pre>