How to turn a gray scanned document background white? Methods to batch enhance image text clarity
Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-08-20 06:37:33
Images of contracts, archives, and receipts captured or scanned with a mobile phone often suffer from issues such as a grayish paper background, uneven lighting, and insufficient contrast between text and background. This article explains how to use the “Image Effect Enhancement” feature in office software to batch-import scanned images such as JPG and JPEG, enable “Text Clarity (Binarization)” and adjust the threshold, converting dim pages into a black-and-white effect with a bright background and prominent text. The operation uses unified parameters for batch execution, making it suitable for processing multi-page contracts and complete sets of materials, and can significantly reduce the repetitive work of editing images one by one.
Scanning contracts, archival materials, or paper forms can produce JPG or JPEG images with grayish paper backgrounds, shadows at the page edges, and insufficiently prominent text, even when the text on the original is perfectly readable. This is especially true when photographing documents with a phone, where ambient lighting, paper color, and camera angle all affect the final result. One or two images can be adjusted temporarily with an image editor, but when facing dozens or even hundreds of scanned pages, adjusting brightness and contrast one by one is not only time-consuming but also likely to cause inconsistent results across pages.
The problem addressed in this article is how to batch-process many gray scanned images into clean-background, sharp-text black-and-white pages. The office software used in the example is HeSoft Doc Batch Tool . By using the "Text Clarity (Binarization)" option under "Image Effect Enhancement," uniform processing parameters are applied to the same batch of files. The entire process does not require opening images one by one, making it suitable for text-heavy scanned materials such as contracts, agreements, forms, exam papers, and archival copies.
Applicable scenarios: which gray scanned images are suitable for batch clarity enhancement
This method is mainly suitable for document images where there is a certain difference in brightness between the paper background and the text. The software distinguishes light backgrounds from dark content according to a set threshold, thereby weakening gray backgrounds, shadows, and paper texture, and making body text, headings, table lines, and other content more prominent.
- Multi-page contracts and agreements: For example, service contracts, procurement agreements, labor contracts, and others with a large number of pages that need to be uniformly organized into clear electronic copies.
- Archives and historical materials: Old paper tends to yellow or gray, and scanned backgrounds are not clean enough. Binarization can enhance the distinction between text and background.
- Exam papers, lecture notes, and book pages: Suitable for processing study materials that are mainly black text with little color information.
- Application forms, registration forms, and internal forms: Pages containing text, underlines, and table lines that need to be more prominent when printed or archived.
- Paper documents photographed with a phone: Photo results are affected by indoor lighting, and backgrounds may appear gray or partially dark. They can be imported together and optimized in batch.
It should be noted that the goal of binarization is to obtain a clear black-and-white document effect. If the images contain colored seals, colored annotations, photos, or gradient graphics that must be preserved, it is not advisable to directly apply the same parameters to all files. It is recommended to first test with a small number of samples to confirm whether colored content can be converted to black and white before processing the entire batch.
Effect preview: dark before processing, bright background after
Scanned image before processing
The original contract image below has a relatively obvious gray background. The overall paper is dark, and the top and bottom of the page also contain shadows and extra areas caused by the shooting environment. Although the body text is recognizable, the contrast between black text and the gray paper is not strong enough, and it may continue to look gray when printed directly.

For such pages consisting mainly of English contract text, increasing brightness one by one may still leave bottom shadows, while only increasing contrast may make some fine characters lighter. Therefore, it is more appropriate to use binarization processing oriented toward text pages, using a threshold to uniformly determine which pixels should remain dark and which areas should be converted to a light background.
Bright effect after processing
After processing, the page background is close to pure white, and the contract title, clause body text, numbering, and underlines are more prominent. The large areas of gray background in the original image are significantly weakened, and the document presents an effect close to a black-and-white scan.

From the before-and-after comparison, it can be seen that this processing is not simply "brightening" the entire image, but rather strengthening the boundary between text and paper background. For text-based scans that need to be read, printed, or electronically archived, this effect is usually more practical than preserving gray paper texture. The actual output quality is still affected by the original image resolution, focus condition, and text darkness, and loss of detail caused by blur or poor focus cannot be fully restored by binarization alone.
Operating steps: batch-convert scanned images into clear black-and-white pages
Step 1: Enter the "Image Effect Enhancement" function
Open HeSoft Doc Batch Tool , and select "Image Tools" in the left function category. After entering the Image Tools page, find and click "Image Effect Enhancement." This function is used to batch-set effects such as rotation, opacity, scaling, text clarity, brightness, contrast, and sharpening for images. This time, the main focus is on text clarity processing.

The purpose of this step is to enter the correct batch-processing task. Because the page also includes format conversion tools for PNG, JPEG, JPG, TIFF, WEBP, and others, if the goal is to improve gray scanned copies rather than simply change the file format, "Image Effect Enhancement" should be selected, and the image format conversion function should not be chosen by mistake.
Step 2: Add multiple scanned images at once
After entering the function page, you first arrive at "Select records to process." If the number of files is small, you can click "Add Files" and select multiple images as needed; if a complete set of contracts or archives is already stored in the same directory, you can click "Import files from folder" to reduce repeated selection operations.

In the screenshot, 10 JPG files are imported at once, and the list displays name, path, extension, creation time, and modification time. After importing, check the number of files and name order first to confirm that no cover photos, colored attachments, or other images that do not need to be converted to black and white have been mixed into the task. If an incorrectly selected file is found, it can be removed using the delete operation on the right side of the corresponding record; if you want to reselect, you can also use "Clear" on the page. After confirming that everything is correct, click "Next."
Step 3: Enable "Text Clarity (Binarization)"
On the "Set processing options" page, turn on the "Text Clarity (Binarization)" switch. After the switch is enabled, a slider from "Pure white" to "Pure black" appears below. In the example screenshot, the value is set to 45%, and the processed contract background is relatively bright while most body text and lines are preserved.

45% is the parameter used in this example and is not a fixed standard for all scanned copies. When the slider moves closer to "Pure white," more light-gray content will be processed into white, which helps clean up gray backgrounds, but excessive adjustment may cause light text, thin lines, or faint seals to disappear. When the slider moves closer to "Pure black," more dark content will be retained, but paper shadows, stains, and gray noise may also be identified as black. Therefore, the reasonable approach is to first select a representative page for testing and then fine-tune based on the output effect.
If the original image direction is already correct and the size is appropriate, this task can enable only "Text Clarity (Binarization)" without also enabling rotation, scaling, brightness, contrast, and sharpening. The more targeted the processing options are, the easier it is to determine which parameter caused the final change. If the original images do have orientation errors or slightly blurred text, you can decide whether to add other effects after testing.
Step 4: Set the save location
After confirming the parameters, click "Next" and follow the process to "Set save location." It is recommended to create a separate folder for the enhanced images and not mix them directly with the original scanned images. This makes it easier to compare the differences before and after processing and also avoids losing the original files if the parameters are unsuitable.
The save directory can be named according to the project, for example "Contract scans_clear version" or "Archive images_black-and-white enhanced." For materials with many pages, try to keep the original file names and numbering relationships so that later sorting, merging, or searching is easier.
Step 5: Start batch processing and check the results
After the settings are complete, enter the "Start processing" stage and execute the batch task. The software will process the imported images in sequence using the same set of text clarity parameters, without requiring the user to repeatedly adjust each image. After the task is finished, open the output directory and spot-check the first page, middle page, last page, and the lightest page to confirm whether the body text, page numbers, table lines, and signature areas are complete.
If some pages are found to have thinner or missing text, you can return to the processing options and adjust the threshold in the direction of retaining more dark content before reprocessing; if the background is still grayish or has too many shadows, you can make a small adjustment in the direction of cleaning up light-gray backgrounds. Do not change the parameters drastically at once, as that may make it difficult to determine the appropriate range.
Frequently asked questions and precautions
Why are there still a few black spots or shadows after processing
If creases, stains, and shadows in the original image are as dark as the body text, they may also be retained during binarization. In this case, the threshold can be adjusted moderately, but it cannot be guaranteed that all noise will be removed while fully preserving light text. When source file quality varies greatly, it is recommended to divide them into two batches by darkness instead of forcibly using a single parameter.
Can binarization restore out-of-focus text to clarity
It can enhance black-and-white contrast and make existing text outlines more prominent, but it cannot reconstruct details that do not exist in the original image. If the shot was severely shaken, focus failed, or resolution was too low, it is recommended to rescan or retake the photo.
Can it be used directly for OCR text recognition
A bright background and clear text are usually beneficial to subsequent recognition, but what this article demonstrates is image enhancement, not completed OCR. Important contracts and archives should still be manually checked after recognition for key fields such as names, amounts, dates, and numbers.
Why is it not recommended to overwrite the original images
The paper color and font darkness of different pages may be inconsistent, and the threshold set the first time may not be suitable for all images. Keeping the original files allows you to readjust parameters at any time and also meets the needs of record retention and traceability.
Summary
When facing a large number of contract, archive, and form scan images with gray backgrounds, instead of opening and editing them one by one, it is better to use the "Image Effect Enhancement" function of HeSoft Doc Batch Tool . Import JPG, JPEG, and other files together, enable "Text Clarity (Binarization)," test and determine a suitable threshold, and then apply the same rule to the entire batch of scans, turning dull gray paper into a bright page and highlighting text and lines.
In actual operation, it is recommended to first copy the original files, then select one to three representative pages for trial processing. After confirming that the background, body text, and fine lines all meet requirements, import the complete folder and execute the batch task. This can reduce repetitive work, maintain visual consistency across multi-page materials, and improve the efficiency of organizing, printing, and archiving scanned copies.
Keyword:Whiten scanned document backgrounds , batch enhance image clarity , process gray scanned images , binarize image text , make contract scans clearer