title: How to create PNG image with color_type=3 and bit_depth=1
body: <p>The source is an RGBA PNG image (color_type=6 and bit_depth=8).</p>
  
  <p>I need an image with indexed color and 2 palette items (color_type=3, bit_depth=1).</p>
  
  <p>I tried with ImageMagick, but was able to reach only 1bit grayscale image (color_type=0, bit_depth=1) or 2bit indexed color image (color_type=3, bit_depth=2) in which only 2 colors are in use.</p>
  
  <p>According to the PNG specification such image is possible, but how to create it?</p>
  
  <p>Here is an image I am trying to convert:</p>
  
  <p><img src="https://i.stack.imgur.com/rr2Tv.png" alt="enter image description here"></p>
  
  <p>The result of <code>"convert input.png -type palette -depth 1 output.png"</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/OUsTf.png" alt="enter image description here"></p>
  
  <p>The result of <code>"convert input.png -type palette -depth 1 -colors 2 output.png"</code></p>
  
  <p><img src="https://i.stack.imgur.com/TlQrB.png" alt="enter image description here"></p>
  
  <p>Both results have bit_depth=2, but the second one uses only 2 colors of 4 possible.</p>