title: How to save .PBM image?
body: <p>I open a pgm file, convert it to numPy array and change all pixels to 0 or 1 (or 255, I don't know how to proceed yet).
  How can I save it as .PBM using openCV?</p>
  
  <p>Like:</p>
  
  <pre><code>P1
  512 512
  0 1 0 0 0 . .
  0 0 0 1 0 . .
  . . . . . . .
  . . . . . . . 
  . . . . . . . 
  </code></pre>
  
  <p>Thanks in advance!</p>