I have some PNG files with multiples sentences in two different colors Black (Davy Gray) and Light Brown (Mushroom).
I'm only interested in the Black text so I tried changing the color of the light brown text to the background color using Input.ReplaceColor but there's many shades of that color and I always end up with some weird characters as a result of the small residues left.
Here's my actual code
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
var ContentArea = new Rectangle() { X = 872 , Y = 130, Height = 900, Width = 725 };
Input.AddImage(@"C:\OCR\Capture (" + i + ").PNG", ContentArea);
Input.ReplaceColor(Color.FromArgb(185, 163, 143), Color.FromArgb(235, 226, 216), 25);
Input.Sharpen();
Input.ToGrayScale();
var Result = Ocr.Read(Input);
richTextBox1.AppendText(Result.Text + Environment.NewLine);
richTextBox1.SelectionStart = richTextBox1.Text.Length;
richTextBox1.ScrollToCaret();
}
Edit : The answer is "No" for now, hopefully they release this feature in the future.
The only option for now is to play with colors until you find the best parameters.
If you have a better alternative than IronOCR and free (even if only for dev), I'll gladly take it.


toleranceparameter onOcrInput.ReplaceColor()and maybe use the same method to make the grey text black.Sharpen()may actually be working against you by darkening faint blemishes. Bottom line: there is probably no definitive general answer here, just trial-and-error fine-tuning for your image.Sharpen()give me worse results (from one character to 20 weird characters per line), I tried playing with the tolerance a lot but I end up messing up with the black text too if I put a higher value.