Schema LawSign in with Google

Can OCR Read Highlighted Text on a Scanned Page?

By Schema LawPublished Updated

OCR can read highlighted text as long as the scan shows the highlighter as a band lighter than the print on it. Trouble starts when a black-and-white scan or a photocopy turns the band dark. Converted text also carries no record of which words were highlighted, so you track those passages yourself.

Can OCR read text under highlighter ink?

Yes, when the letters are still darker than the band around them in the image. Highlighter ink is see-through on paper, and recognition works from the contrast between a letter and its background. A pale band lowers that contrast a little. A band that has scanned as dark gray or black removes it.

So the question to ask of any highlighted page is about the image you hold, and you can answer it by looking. Open the scan, zoom to a highlighted line and compare it with a plain line beside it.

What the highlighted line looks like on screenWhat to expect from conversionWhat to do
Tinted band, letters as crisp as on the plain linesText much like the plain linesConvert, then read the highlighted lines against the image
Mid-gray band, letters visible but dullSome wrong or dropped characters inside the bandRescan from paper in color if you can; otherwise proofread the band
Speckled band, letters broken up by dotsStray marks mixed into the wordsRescan in color or grayscale
Solid dark bar, no letters visibleNothing, or a few stray charactersFind another copy; the words are not in this image

Two smaller effects are worth a look even on a good scan. A wet highlighter drags fresh inkjet print or pen ink sideways, so the letters under the band can be smeared on the paper itself. And a band that stops in the middle of a word leaves that word half on tint and half on white, which is the spot where a character goes missing.

When your client highlights a contract or a witness statement, the color marks the lines they want found, often a passage about what the witness saw or a habit they describe. Your converted file will not show that color. Note which lines were marked, including any you may use in rebuttal, so a later reader can find the same words on the unmarked scan.

The only way to know how a given tool handles your pages is to run one. Schema Law's free plan reads one document a day of up to three pages, and it shows you each parsed page so you can compare it with the scan before you export. Recognition is strongest on clean print, and nothing marks a passage as uncertain, so the highlighted lines are yours to check. The upload, parse and export steps are on the home page.

Why does yellow highlighter scan clean while pink and blue turn dark?

Yellow is the lightest of the common highlighter colors, and pink, blue, green and orange are darker. A scanner set to black and white must call every dot either black or white. A light band falls on the white side and disappears. A darker band can fall on the black side and bury the print.

That is why the same marked-up page gives different results on different days. The pen did not change. The scan mode did. A color or grayscale scan records the band as a tone between white and black, and the print stays darker than the tone. The post on grayscale and black-and-white scanning explains what grayscale keeps, including highlighter, and how to choose a mode for a whole set.

A one-page test before you feed the stack

If you hold the paper, a short test settles the setting for your scanner and your pens:

  1. Pick the page with the most colors of highlighter on it. If the file has only yellow, add a page where the yellow runs over small print or a footnote.
  2. Scan that page three times: black and white, grayscale and color.
  3. Open the three images side by side and zoom in on the darkest band.
  4. Rule out any mode in which a band has become darker than the plain paper by more than a tint.
  5. Convert the surviving images and compare the highlighted lines word by word with the paper.
  6. Scan the rest of the file in the lightest mode that passed, and write the mode in the file note.

Things that change the result

  • Old highlighting. Highlighter ink changes with age and light. A band that has faded is paler, which helps. One that has darkened or discolored does not, so judge old marks by how they look now.
  • Two passes of the pen. Where strokes overlap, the ink is twice as dense. Look at the overlaps, not the middle of a stroke.
  • Colored paper. Blue highlighter on a pink or yellow sheet is darker than either alone.
  • A brightness or threshold control. Some scanner software lets you move the point at which gray becomes black. Moving it can save a band and lose faint print elsewhere on the same page, so check both.

Highlighting on a photocopy or fax that has turned to gray bars

On a photocopy or fax, the highlighting is no longer ink over print. The copier already flattened both into one black-and-white image, and the band is now a gray or black bar made of the same toner as the letters. Rescanning that sheet in color brings nothing back, because the color was never copied.

What you can still do depends on what the bar looks like:

  • A pattern of fine dots with letters showing through. A grayscale scan at a higher resolution sometimes keeps the letters apart from the dots. Try it on one page and compare.
  • Dense gray with faint letters. Expect errors in every word. Convert the page for the sake of the rest of it, and type the barred lines yourself from the best view you can get.
  • Solid black. The words are gone from this copy. Nothing in the image separates them from the bar.

In the second and third cases the better use of your time is finding a cleaner source. Ask whoever sent the copy whether the marked-up paper still exists, or whether an unmarked copy of the same document does. A clean copy gives you the text, and the marked copy still tells you which lines the reader cared about.

Before you treat a solid bar as old highlighting, consider that it may be a deliberate redaction. Highlighting follows a line of text loosely, with uneven ends and a hand-drawn slant, and it covers passages a reader wanted to find again. A redaction has square edges and covers names, numbers or whole paragraphs. The guide to redacted documents describes black bars, white boxes and marker redactions and how to note them.

Does converted text record which passages were highlighted?

No. Recognition returns the characters on the page, and a colored band is not a character. Export to Word, plain text or a spreadsheet and the highlighted sentence looks like every other sentence. If the marks matter, you have to carry them across yourself.

They do matter in some files. A client's highlighting on a contract shows what the client read closely. Highlighting on a produced document may be part of what the page shows, and the plain text will not tell a later reader it was there.

Ways to keep the marks:

  1. Keep the color scan as the record. A searchable PDF export keeps your original page image with a hidden text layer behind it, so the highlighting stays visible and the words become searchable.
  2. Tag the passages in a working copy. In a Word or text export, put a plain marker around each highlighted passage, for example [HL-yellow: ... ], with the color named if the file uses more than one.
  3. Keep a short list. One row per passage is enough.
PageColorFirst words of the passageWhose marking, if known
4Yellow"Tenant shall give written notice"Client
4Pink"not later than ninety (90) days"Client
11Yellow"Landlord may, at its option"Unknown; on the copy as received

The names and wording in that table are made up for illustration. Use the columns and fill in your own.

Two cautions. Do not re-apply highlighting in the exported Word file and treat that file as a copy of the original, because the new marks are yours and their edges will not match. And do not confuse highlighting with a line drawn through words. A strike changes what the text says, and the post on whether OCR can read strikethrough text deals with that.

Sticky flags and notes left over highlighted passages

A sticky flag or note is opaque, so the scanner records the flag and not the words beneath it. Highlighter dims text. A flag removes it from the image. A flag marks a line somebody wanted to find again, so assume the covered words matter until you have read them.

Handle a flagged page in two passes:

  1. Scan the page as it arrived, flags and notes in place. That image shows how the document was marked up and where each flag sat.
  2. Note the position of each flag on a slip or in the file note, then lift it and scan the page again without it. Move a translucent flag as well, because its colored end can scan dark enough to hide the words under it.
  3. Put the flags back if the paper has to be returned in the state you got it.
  4. Convert the clean scan for text, and keep the first scan beside it.

If you received only a scan and the flags are in the image, the covered words are not in your file. Look for a block of wrong or missing text the size of the flag, mark it in your working copy as covered, and ask the sender for a rescan with the flag lifted.

Sticky notes with writing on them are a document of their own. Scan each one where it sits, then separately on a blank backing sheet with a note of the page it came from. Handwriting on the note is harder to convert than the print under it, and the post on what OCR can read in handwritten notes covers what to expect.

All posts in Difficult scans