With the prevalence of smart phone cameras today, they are often used instead of scanners as quick digitization methods for documents. Unfortunately this leads to excessive vignetting (darkened areas at the edges), which makes it hard to print the document legibly.
For simple text documents and line drawings, however, it just takes four simple steps to correct the image. The following describes the steps in GIMP, but the same should apply to PhotoShop and probably other image manipulation software as well.
1. Open the document in GIMP. In the layer dialog create a duplicate of the image layer, so you have two identical layers.
2. Apply Filter → Blur → Gaussian Blur on the top layer with a very large radius. The goal is to create a smooth surface with no indication of the original text or drawing. A blur radius of around 1/10 of the image dimensions should be adequate.
3. Change the top layer mode from Normal to Divide. This will remove the majority of the vignetting. Only a little noise will remain in some parts of the image.
4. Flatten the image (Image → Flatten Image), and use Colors → Levels to finalize the image. Change the histogram to logarithmic view to better see the levels. Drag the black and white points so that the text becomes black and all of the page white. Then use the gamma selection to fine-tune the text/drawing thickness.
If any noise remains in the image corners, just paint over them in white.
This method works only for text and line drawings, where there are no large areas of non-white color. If there’s a photo on the page, select the photo and cut it out from the top layer. (Alternatively you can try to select the page area using the fuzzy select and/or color select tools, and copy-pasting that to the top layer.) Then lock the alpha channel in the layer settings before blurring the top layer. This will omit the devignetting from the image area.
Thanks to Arttu Peltoniemi for the test image.
