What should I do if the scanned images of a multi-page contract are too gray? Tutorial on batch converting JPG to black and white and enhancing text
Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-08-20 06:37:55
After scanning a multi-page contract as JPG or JPEG, if the paper background is dim, shadows are obvious, and text contrast is insufficient, retouching page by page can consume a lot of time. This article uses a set of contract images as an example to explain how to batch import files through the "Image Effect Enhancement" feature of office software, use the "Text Clarity (Binarization)" setting to unify the threshold, and then choose a save location and output centrally. The tutorial also explains the meaning of the 45% sample parameter, the limitations of color content processing, and methods for checking the results, helping users efficiently produce clear and bright black-and-white scanned copies.
When organizing paper contracts, a common practice in enterprises is to use a scanner or mobile phone to save each page as a JPG or JPEG image. However, the device's automatic exposure is not always ideal: white paper may be photographed as light gray, shadows may appear around the edges of the page, and old contracts may also have a yellowed background. Such images are barely readable on a computer, but they tend to look dirty after printing, and the text is not prominent enough when magnified for reading.
If a contract has more than a dozen pages, and a project includes multiple contracts, adjusting each page with photo-editing software creates a large amount of repetitive work. This article introduces a processing method more suitable for office scenarios: use HeSoft Doc Batch Tool to import multiple contract images in a unified way, and use "text clarity (binarization)" to convert the gray paper background into a bright background while strengthening the body text, headings, and table lines. The focus of this article is not to convert JPG into another format, but to improve the readability and black-and-white effect of the scanned images themselves.
Applicable scenarios: multi-page text materials that need unified clarity
Batch binarization is suitable for a group of images with similar content structure, mainly composed of dark text and light paper. Compared with brightening each image individually, unified parameters can keep the visual style of consecutive pages consistent, and it is especially suitable for the following work:
- Organizing paper purchase contracts, service agreements, quotations, and acceptance materials into clear electronic files;
- Processing JPG and JPEG document pages whose backgrounds look gray after scanning;
- Uniformly optimizing complete sets of application forms, registration forms, meeting materials, and training handouts;
- Cleaning up large gray backgrounds before printing to avoid printing an entire page with a gray background;
- Preparing images with more obvious contrast for subsequent manual reading, data entry, or OCR recognition.
If a batch of files contains both black-and-white body text pages and colored certificates, photos, seals, or charts, it is recommended to classify them first. Text pages can be batch-processed using the method in this article, while pages that must retain color should be saved separately. Binarization converts images into an effect dominated by black-and-white levels, so it is not suitable for materials that require faithful color reproduction.
Effect preview: comparison before and after cleaning up the gray background of a contract
Before processing: the page is grayish and shows traces of photographing
In the original image, the contract body text is basically complete, but the paper does not appear clearly white. The entire page is covered with a light gray tone, and the top and bottom still retain the shooting environment and shadows, so the contrast between the text and the background is limited.

The problem with this kind of scanned copy is not only that it "does not look white enough." When the image is used for printing, inserted into a Word document, or further combined into a PDF, the gray background will also be fully preserved, which affects the cleanliness of the layout and may increase the reading burden. If the grayscale differs on each page, the final material may also appear with some pages bright and others dark.
After processing: the paper tends to become pure white, and the body text is more concentrated
After text clarity processing, the contract background becomes noticeably whiter, and the title, clause numbers, body text, and underlines show stronger black-and-white contrast. The originally large gray areas on the page are cleaned up, making the whole document closer to a standard black-and-white scanned document.

The processed result is suitable for office materials whose main purpose is content reading. It should be viewed objectively that binarization mainly improves the boundary between the background and the text and does not increase the actual resolution of the image. Characters that are already broken, overexposed, or out of focus in the original image may still need to be rescanned before they can be fully restored.
Operation steps: from importing contract images to batch output
Step 1: Open effect enhancement in the image tool
After starting HeSoft Doc Batch Tool , click "Image Tools" on the left. The right side will display several image processing functions, including image format conversion and image effect enhancement. Select the first item, "Image Effect Enhancement," to enter this batch task.

The reason for choosing this entry is that we need to change the display effect of the images, rather than converting JPG into PNG, BMP, TIFF, or WEBP. Format conversion only changes the file container format and usually cannot automatically remove the gray background of scanned copies; "Image Effect Enhancement" is the option that contains the text clarity setting required by this tutorial.
Step 2: Import all contract pages and check the list
After entering the task, add images on the "Select records to process" page. The page provides two entry points: "Add files" and "Import files from folder." When contract pages are stored separately, you can add multiple files; if pages such as contract-1.jpg and contract-2.jpg are already in the same directory, importing directly from the folder is usually more convenient.

In the example list, there are 10 records with the jpg extension. After importing, do not immediately proceed to the next step. It is recommended to complete three checks first: first, whether the total number of records matches the number of contract pages; second, whether the file names maintain the correct page order; third, whether any colored attachments that do not need black-and-white processing have been mixed in. The right side of the list provides a single-item removal operation, and there is also "Clear" at the top of the page, which can be used to correct the selection result.
After confirming that the files are correct, click "Next." The advantage of batch processing lies here: you only need to complete one import and one parameter setting, and all subsequent pages will be executed according to the same rule, without repeatedly opening ten or even hundreds of files.
Step 3: Set text clarity and the binarization threshold
After entering "Set processing options," you can see items such as rotation angle, opacity, shrink or enlarge, text clarity (binarization), brightness, contrast, and sharpness. For gray text scanned copies, first turn on the "Text clarity (binarization)" switch, and then drag the slider below to set the threshold.

The example value in the screenshot is 45%, with "Pure white" marked on the left side of the slider and "Pure black" marked on the right. This parameter determines whether grayscale content is more likely to be converted into a white background or black content. Adjusting toward pure white can clean up more light gray backgrounds, but light handwriting and thin lines may also turn white at the same time; adjusting toward pure black can retain more light text, but may also turn paper shadows and stains black.
For ordinary printed contracts, you can start testing around the 45% shown in the screenshot, but do not treat it as a universal optimal value. The scanner, mobile phone camera, paper color, and printing ink will all affect the result. If the pages in the same batch of contracts differ greatly in lightness and darkness, you can first group them into "brighter pages" and "darker pages," and then process them with different thresholds separately. This is usually more reliable than using an extreme parameter for all files.
In the example, the other effect switches remain off, indicating that the result this time is mainly produced by text clarity binarization. If the images have no rotation, size, or transparency problems, there is no need to modify these items at the same time. Only when test processing confirms that there is still a need for brightness, contrast, or sharpness adjustments should you add them one by one, to avoid difficulty in locating problems after multiple parameters are stacked together.
Step 4: Choose a separate save directory for the processed results
After completing the parameter settings, click "Next" to enter "Set save location." It is recommended to create a new output folder alongside the original image directory, such as "contract-clear" or "enhanced scanned contracts." Do not easily overwrite the original JPG or JPEG files, because you may need to change the threshold and regenerate them later, and the original images are also an important basis for tracing the materials.
If the contract images will later be inserted into doc or docx documents or combined into a PDF, you can check the file naming before output. Using a consistent number of digits, such as 01, 02, 03, helps the system arrange them in the correct page order; if the original files already have a stable order, try to preserve their naming relationship.
Step 5: Start processing and conduct sample review
Enter the "Start processing" stage in the workflow and execute the task. The software will process all images in the list in sequence. After processing is complete, open the output directory and conduct a sample review of the results. It is recommended to check at least the first page, the page with the lightest text, a page with a table, and the last page.
During review, do not only look at whether the background has become white; also check whether the contract number, amount, date, small-font notes, underlines, signatures, and seal edges are complete. If the background is clean but fine text disappears, it means the current setting is too aggressive in cleaning up light content; if the text is complete but the paper still has large black or gray shadows, then you need to fine-tune in the direction of cleaning the background. Once a suitable value is found, re-run the entire set of files.
Common questions and handling suggestions
Can both JPG and JPEG be processed in this way
JPG and JPEG are common scanned image extensions and often appear together in actual work. Whether they can be imported should be determined by the actual recognition result in the software interface. The screenshot already shows that jpg files can be added to the task in batches. For other image formats, it is also recommended to first test with one sample to confirm that display and output are normal before batch execution.
Why do some pages produce good results while text is lost on others
This is usually because the exposure and ink color differ greatly from page to page. A unified threshold is suitable for images generated by the same device under similar conditions; if the sources are different, they should first be grouped by brightness and darkness. Especially light pencil writing, light-colored seals, and thin table lines need to be preserved more carefully.
Can the processed files directly replace the original contracts
Enhanced images are suitable for reading, printing, and daily organization, but whether they can replace the original scanned copies should be judged according to the enterprise's archival system and business requirements. It is recommended to keep both the unmodified original images and the enhanced versions, and for important legal or financial materials, do not keep only the processed black-and-white images.
Can brightness, contrast, and sharpness be enabled at the same time
The interface does provide these processing options, but it is not recommended to enable all of them in the first attempt. First test the binarization effect alone, and then adjust the items one by one according to the actual problem, which makes it easier to obtain stable results. Excessive sharpening may strengthen noise, and excessive contrast may also cause loss of light-colored characters.
Why conduct a sample test before batch processing
A single set of parameters will be applied to all imported images. If you only discover that the threshold is inappropriate after directly processing hundreds of pages, it will increase the rework time. First select one of the brightest pages, one of the darkest pages, and one ordinary page for testing, so you can more quickly determine whether the parameters can accommodate the entire batch of materials.
Summary
When the background of multi-page scanned contracts appears gray, what is truly time-consuming is not adjusting a single page, but the repetitive operations and saving page by page. With HeSoft Doc Batch Tool , you can import a complete set of JPG and JPEG pages at once in "Image Effect Enhancement," set a unified threshold through "Text clarity (binarization)," and then save and output them centrally. This can significantly reduce repeated clicking and make the page style of the same contract more consistent.
It is recommended to first copy the original contract images, select three of them, and try processing them in the software. You can start observing near the 45% value in the example, focusing on checking small text, lines, and signature and seal areas. After confirming that the parameters are reliable, import the complete folder to execute the batch task, so that you can more efficiently complete the removal of gray backgrounds, black-and-white conversion, and clarity enhancement for contract scans.
Keyword:Make contract scans clearer , batch convert JPG to black and white , enhance JPEG text , remove gray background from scanned images , batch binarize images