How to detect font type[bold, italic] and font color while scanning text through OCR?


I want to implement the feature in iOS to get Questions and answers from the image taken by a camera from the phone.

To exemplify, (see below). I need to fetch questions and answers from that. And especially the main focus is to detect the bold answer or answer with red color. So I would like to know is there any way to detect the bold or red color fonts from that through OCR while scanning and fetching text?



Detecting font information (bold, italic, cursive, font name) is a popular feature request, and we fully understand that. Unfortunately our solution can not detect bold as an attribute to a word yet. So the word will be OCR’ed ok, but the “bold” attribute/information is lost. And to my knowledge, no current OCR solution in the market can detect a bold/italic attribute or even the font name.

However, things look better with finding the red answer. If your text is like in your example, just with a red answer, you can pre-process the image before feeding it into the OCR API. During pre-processing remove all black (and dark grey?) colors from the image, so only the red text remains.

For removing the black color, have a look at the free command line tool imagemagick. Here is a related StackOverflow answer that shows what I mean: Remove all except one colour from an image


Thank you for your brief response.


Can OCR detect roboto red colour font texts from image ?? please provide the solution.