title: Image processing for OCR with leptonica (inverse color text)
body: <p>I am trying to process the following image with leptonica to extract text with tesseract.</p>
  
  <p><strong>Original Image:</strong>
  <img src="https://i.stack.imgur.com/YMt9d.png" alt="original image"></p>
  
  <p>Tesseract on the original image yields this:</p>
  
  <pre><code>i s l
  D2J1FiiE-l191x1iitmwii9 uhiaiislz-2 Q ~37
  Bottom linez
  With a little time!
  you can learn social media technology
  using free online resources-
  And if you donity
  youlll be at a significant disadvantage
  to
  other HOn-pFOiiTS-
  </code></pre>
  
  <p>Not great, especially the top background. So using leptionica I use a background removal algorithm (blur, difference, threshold, invert) to get the following image:
  <img src="https://i.stack.imgur.com/wJrnH.png" alt="processed image"></p>
  
  <p>But tesseract doesn't do a good job with it:</p>
  
  <pre><code>@@r-mair lkrm@W lh@w ilr@ mJs@ iklh@ ii@c2lhm1@ll
  mm Mime
  VWU1 a Mitt-Jle time-
  @1m ll@@Wn Om @@@lh1
  using free onhne resources-
  Andifyoudoni
  9110 ate a $0 D
  to other non-profrts
  I
  </code></pre>
  
  <p>The main problem, it seems, is that now all of the text is outlined instead of solid. How can I adjust my algorithm or what can I add to made the text solid?</p>