in scanned pictures (e.g. pages from textbooks) sometimes there is a gray background.
Or in the following example, the only photo-copy I had available for scanning was of poor quality:

Especially for the picture above, I didn't find a way to improve the quality, i.e. make the text in the boxes good readable.
I tried with Faststone Image Viewer and Paint.net, using all functions that I found for changing the contrast etc., but to no avail.
Does someone of you know a way to make the text better readable?
Maybe a special (free) program, or perhaps a clever algorithm written in PureBasic?
I think an appropriate algorithm based on wavelets might do the trick, but currently I don't know enough about wavelets for writeing such a program myself.
Thanks in advance for any suggestions that point into the desired direction.