Fix Uneven Lighting on Scanned Documents in GIMP
Uneven illumination, shadows, and lighting gradients are common issues when photographing or scanning thick books and paper documents. This guide outlines the most effective, standard method in GIMP to flatten uneven background lighting and restore crisp, readable text using the Divide blend mode technique, followed by basic tonal adjustments.
Step 1: Open the Image and Duplicate the Layer
- Open your scanned document in GIMP by going to File > Open.
- Open the Layers panel (Windows >
Dockable Dialogs > Layers or press
Ctrl + L). - Right-click the background layer and select Duplicate
Layer (or press
Ctrl + Shift + D).
Step 2: Extract the Illumination Gradient
To remove the uneven lighting, you must isolate the gradient pattern from the text:
- Select the duplicated (top) layer in the Layers panel.
- Navigate to Filters > Blur > Gaussian Blur...
- Increase the Size X and Size Y sliders. The goal is to blur the layer until the text completely disappears and only the uneven lighting and background tone remain visible. For high-resolution scans, this usually requires a radius between 50 and 150 pixels.
- Click OK to apply the blur.
Step 3: Remove the Gradient Using the Divide Mode
- Keep the blurred top layer selected.
- In the Layers panel, find the Mode dropdown menu (set to "Normal" by default).
- Change the mode to Divide.
The Divide blend mode mathematically cancels out the background brightness variations captured in the blurred layer, resulting in a flat, evenly illuminated document background.
Step 4: Merge the Layers
- Right-click on the top layer in the Layers panel.
- Select Merge Down to combine the correction with the original image into a single layer.
Step 5: Clean Up Contrast and Colors
After flattening the illumination, adjust the contrast to make the text crisp and the paper pure white:
- Go to Colors > Desaturate > Desaturate... and click OK if your document is black and white. This removes any chromatic noise or color tint.
- Go to Colors > Levels...
- Adjust the Input Levels sliders:
- Drag the right (white point) slider slightly to the left until the paper background turns pure white.
- Drag the left (black point) slider to the right until the text appears dark and sharp.
- Click OK to apply the changes.
Step 6: Export the Cleaned Document
- Go to File > Export As...
- Choose your preferred file format (such as PDF, PNG, or TIFF) to preserve text sharpness.
- Click Export.