title: How to convert an image to 1bit/px binary bitmap with ImageMagick or RMagick?
body: <p>I'm looking for the command and options to convert images (png, jpeg, whatever…) to 1bit/px bitmap image (similar to what happen when in photoshop when you convert it to bitmap). See example below</p>
  
  <p>I'd like to do it programatically from within a rails app (e.g. RMagick or through ImageMagick)</p>
  
  <p><img src="https://i.stack.imgur.com/zJKoy.jpg" alt="enter image description here"></p>
  
  <p>The following works : </p>
  
  <pre><code>convert yo.jpg -remap pattern:gray30 mono.gif
  </code></pre>
  
  <p>but I' like to understand better what's happening, compared to what phosotsohp would do in that case; considering the many possibilities explained <a href="http://www.imagemagick.org/Usage/quantize/" rel="nofollow noreferrer">here</a>  (@roger_rowland thx for the link again)</p>
  
  <p>In the end what I want to do is to have this "effect", and to enlarge the image without ending up with a blurry effect</p>