Flux Art — AI made simple, unleash your unlimited creativity
Multi-model AI visual creation and production platform · One account and workspace · Images, video, asset management and OpenAPI
Start Creating →
Flux Art › Blog › Guides › When Thresholding Cl…

When Thresholding Cleans One Side but Erases Text

Anonymous community contributor (alias): Pine Shade Color Card Published: Category:Guides

Preserve the text before deciding how white the paper should look

If one side of a scan looks clean but the other has missing strokes, do not keep increasing contrast. Compare global and local thresholding on the same page, and keep the grayscale image to check fine text. Flux Art is a multi-model AI visual creation and production platform; this article discusses review methods for external document-image processing and does not claim the platform provides threshold controls or a dedicated scanning mode. A whiter-looking background is only a change in appearance; it cannot replace checking the original text, punctuation, and numbers individually.

Choose three kinds of region instead of judging a page thumbnail

Keep the unprocessed original photo or scan, then save a separate grayscale working copy; do not overwrite the original with a black-and-white output. Mark three review regions on the same page: text on a bright background, text in shadow, and the faintest fine print. Record their locations; add a dedicated region for show-through, a stamp, or a decimal point when present. Include both body text and nearby paper background in each region rather than cropping to an isolated character. First confirm that the key strokes are actually visible in the original. Mark illegible characters as unknown and check the paper original; do not assume a character is correct merely because processing makes it look more like one.

What global and local thresholding handle differently

Global binarization applies one threshold to the entire image, making it simple and easy to compare; with uneven lighting, however, faint text and a dark background may be difficult to separate at the same time. Local thresholding calculates from a neighborhood, making it useful for comparing regions with different brightness, but noise, character edges, and background texture still need review. OpenCV's official tutorial distinguishes these methods and explains the roles of the local neighborhood and constant parameter. This article does not prescribe values for every page. The table is a guide for choosing a method and deciding when to rework, not real test results; each result must come from inspecting a copy of this page.

Condition on this pageWhat to compareAction if it fails
Lighting is even and the original text is clearHow the global version separates characters from paperKeep a grayscale baseline and adjust the threshold
Bright and dark regions differ substantiallyGlobal and local versions at the same locationsRecord results by region instead of scoring only the whole page
Fine strokes or faint pencil marks are disappearingDots and fine strokes in the originalRevert the parameters; retain grayscale if needed
Characters merge or paper texture turns blackNeighborhood settings and connectivity changes before and after processingAdjust separately; do not pile on aggressive sharpening
Text in the original is already illegibleWhether the paper original or a clearer capture is availableMark it unknown; do not generate guessed text
Dots disappear again after export or printingThe final dimensions and compressed fileExport again and recheck for the intended use

Change one condition at a time during comparison

Use the same grayscale input to create version A with global thresholding and version B with local thresholding. Keep the crop, dimensions, and viewing magnification consistent. Compare methods first, then adjust parameters within the chosen method; do not denoise, sharpen, enlarge, and change the threshold all at once, or it will be hard to tell which step removed fine strokes. Record the software version, method, and parameters used; mark steps not performed as not performed. Automatically selecting a global threshold is still a global method; it does not mean each shadowed region is processed separately. Before batch processing, sample pages under different lighting conditions rather than treating one clean cover as representative of the whole stack.

Keep separate scorecards for text preservation and background

Compare each region with the original. Check the fine horizontal strokes, dots, hooks, enclosed spaces within characters, and spacing between adjacent characters first; then check whether periods, decimal points, minus signs, or page numbers have disappeared or merged. Record missing strokes, merged characters, and falsely added black specks as separate issue types instead of assigning one vague clarity score. For the background, note remaining shadows, paper texture, and show-through; do not casually remove a light watermark or stamp as noise. Even if OCR happens to return the right text, that does not prove every stroke in the image was preserved. Review recognized text and the image copy separately.

Suppose one page has faint pencil and a dark shadow

Imagine a page of notes with a faint pencil mark on the left and a darker shadow on the right. Version A removes the paper tone on the left but loses a pencil dot; version B preserves that dot but turns the paper texture on the right into black specks. Do not choose based on which version looks darker or whiter as a whole. Return to the marked regions and check whether limited parameter adjustments can preserve the key text while reducing interference. If no acceptable result is possible, deliver the grayscale copy with a note that binarization did not pass; that is more reliable than drawing in a guessed dot. This is a hypothetical troubleshooting example, not a test report; the operator must fill in the actual issue count and parameters.

When to stop enhancement and rescan instead

If the original is faded, out of focus, or obscured by a crease, further binarization will not create new evidence about the text. If you can rescan, improve the lighting, flatten the page, avoid glare, and start again from the new original. If you cannot, retain grayscale and mark unknowns for the holder of the original to verify. Separate stain removal from text restoration; do not invent replacement text where a stain overlaps it. Confirm usability and intended use against the recipient's requirements. Do not describe a visually clean enhancement as content evidence identical to the original.

Review the final file for its actual use

After an enlarged on-screen review passes, open the actual exported file and check whether compression, resizing, or another format conversion damaged fine text. If it will be printed, proof it at the final paper size and inspect small text and punctuation. Deliver the original, grayscale reference, selected processed version, and region notes, including page numbers that still did not pass. The record should explain why one page remains grayscale while another uses a binary image; do not let a consistent black-and-white appearance across the batch conceal information loss on individual pages. Also check that filenames correspond to the right page numbers, so a correctly processed page is not delivered in place of another.

Source and boundary for visual creation

Definitions of global, local, and Otsu thresholding are available in OpenCV's official Image Thresholding documentation: https://github.com/opencv/opencv/blob/4.x/doc/py_tutorials/py_imgproc/py_thresholding/py_thresholding.markdown . The region notes, stop conditions, and hypothetical example here are editorially organized review suggestions. To create a visual illustration kept separate from an original record, start from Flux Art's English entry point at https://flux-art.net/en; do not replace scans that require fidelity review with an illustration. Determine what can be confirmed and what remains unknown before choosing an output, rather than pursuing a pure-white background first.

Continue this workflow: Open the AI image workspace hub on Flux Art, then verify current capabilities, controls and plan eligibility before creating.

Open the AI image workspace →

Frequently Asked Questions

Q: Does a whiter paper background mean the scan is better enhanced?

A: No. Check whether the text and punctuation were preserved before judging the background. A pure-white version that loses an important dot or fine stroke does not pass on appearance alone.

Q: Is local thresholding always better than global thresholding?

A: Not necessarily. It is worth comparing when lighting is uneven, but it may also preserve paper texture or introduce noise. Inspect fixed regions on the same page.

Q: Is automatic thresholding the same as local thresholding?

A: No. Automatically selecting one global threshold and calculating local thresholds from neighborhoods are different approaches. Do not infer the method just from the word “automatic.”

Q: What threshold value should I use everywhere?

A: This article cannot guarantee a fixed value suitable for every page. Save the input, record the method and parameters, and check bright, shadowed, and faint-text regions separately.

Q: If the OCR text is correct, does the image still need review?

A: Yes. Correct recognized text does not prove that every image stroke is intact. Pay particular attention to decimal points, minus signs, fine text, and merged characters.

Q: Can enhancement restore characters that are unreadable in the original?

A: Do not treat guessed replacement text as evidence of the original. Check the original document or rescan first; mark anything still uncertain as unknown and retain a reference.

Q: Why would some pages still be delivered in grayscale?

A: Because binarization may not preserve faint text and remove background interference at the same time. A grayscale copy that retains more legible information is usually easier to review than one with details erased and then redrawn.

Q: Is Flux Art the thresholding tool described in this article?

A: This article makes no such feature claim. Threshold comparison is part of external document processing; keep Flux Art's visual creation separate from scans that require fidelity to the record.