title: Why can't tesseract extract text that has a black background?
body: <p>I have attached a very simple text image that I want text from. It is white with a black background. To the naked eye it seems absolutely legible but apparently to tesseract it is a rubbish. I have tried changing the oem and psm parameters but nothing seems to work. Please note that this works for other images but for this one.</p>
  <p><a href="https://i.stack.imgur.com/lKpdZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lKpdZ.png" alt="It should be extracted as Chand" /></a></p>
  <p>Please try running it on your machine and see if it works. Or else I might have to change my ocr engine altogether.</p>
  <p>Note: It was working earlier until I tried to add black pixels around the image to help the extraction process. Also I don't think that tesseract was trained on black text on a white background. It should be able to do this too. Also if this was true why does it work for other text images that have the same format as this one</p>
  <p>Edit: Miraculously I tried running the script again and this time it was able to extract Chand properly but failed in the below mentioned case. Also please look at the parameters I have used. I have read the documentation and I feel this would be the right choice. I have added the image for your reference. It is not about just this image. Why is tesseract failing for such simple use cases?</p>
  <p><a href="https://i.stack.imgur.com/ZbDao.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZbDao.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/4HU9o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4HU9o.png" alt="enter image description here" /></a></p>