Blog
OCR & Scanning

Blog

How to Handle Diagrams and Images in Extracted Question Banks

Circuit diagrams, graphs and figures need special handling during extraction — here's what can go wrong and what correct handling looks like.

FFormatly Team3 min read

Why images are the fragile part

Text extraction has gotten reliable enough that most of the remaining failure cases in question-bank conversion come down to images — a circuit diagram, a graph, a labelled figure a question depends on. Unlike text, an image can't be "read" and reproduced; it has to be located on the page, cropped out, and correctly attached to the right question, option or solution field it belongs to.

Where this typically breaks

The most common failure is a diagram attaching to the wrong question — easy to happen on a page where OCR reading order gets jumbled, especially in a two-column layout where a diagram sits between two questions and it's genuinely ambiguous which one it belongs to without deeper reasoning about the page structure. A close second is an image being dropped entirely rather than mis-attached, which is easier to notice (the question visibly has no image where one is clearly referenced) but just as disruptive.

What reliable handling looks like

Test Formater treats a source document's own explicit structure — question numbering, ordinal position — as the primary signal for where an image belongs, only trusting that positional match when it's actually reliable (matching count between images and questions), and otherwise leaving the association to the AI's own reading of the page rather than forcing a guess that's more likely to be wrong. It's still worth a quick visual check on any question involving a diagram after extraction, especially from a source with a dense or unusual page layout — reliable isn't the same as infallible.