this howto is for people who already know how to use GIMP

how to postprocess photographed book


Sometimes you photo some book in the library. The effect usually looks like that:

The light is never equal on all picture - some parts are brighter, some parts are darker. This is bad if you plan to OCR it or convert to djvu. Here I will describe how to postprocess such photo in GIMP, so it is equally light in all parts.


I open this photo in Gimp. Then I do a second copy of a layer. Now I have two layers with two copies of the same image.


Then I blur the upper layer with gaussian blur, with a large radius, e.g. 100 pixels.

The effect looks like that:

As you can see, the blured image shows us what parts of the image are dark and what parts are bright.


Now I change the mode of this upper (blured) layer to divide.

This causes the bottom layer to be divided by the upper one. The result looks like that:


Now I flatten image.


I correct levels a little bit and have something like that:

great!

Post scriptum: you can do the same using imagemagick:

$ convert input.png -resize 4% -resize 2125x2716 blur.png ; 
$ convert input.png blur.png -fx '(u/(v+0.001))' -threshold 80% output.png
2125x2716 in this example is the size of input.png.