3

I use Linux, and sometimes I need to make a document printable when it was photographed in a very imperfect way. A page from a rather complicated example that I recently needed to handle is this one:

enter image description here

Usually, playing with levels or curves produces workable output. But not in this one, because different parts have very different light/darkness. So either I lose some of the line image (score) on the top left, or else the bottom right has some darkness on the background, which makes the score hard to read when printed on a laser printer.

This particular image was successfully fixed by onlinecamscanner.com - but (a) there is no fine-tuning there so it does not work on everything, (b) it's rather awkward to use, especially its crop stage, (c) what if this service goes away?

So, I'd like some way to have an effect like that on my Linux machine. An effect that preserves the image (which is all dark lines) but makes the background white. Ideally more tunable than what is on that website. Where can I get this?

2
  • This likely can be solved with a high pass filter. There are high pass filter plugins available for GIMP IIRC
    – 小太郎
    Commented 3 hours ago
  • The mkbitmap command of potrace (part of the potrace package in Debian and Ubuntu) can give very nice results in these cases with very little effort. I suggest taking a look at potrace.sourceforge.net/mkbitmap.html
    – Zoltan
    Commented 1 hour ago

2 Answers 2

8

In such cases, with gimp and a little bit of manual labor:

  • select the brightest WHITE spot, and apply levels and set white point to that white spot in the top left
  • after that, switch to quickmask, and make black-white gradient from that brightest white spot to the darkest white spot, and switch off quick mask
  • now, select the darkest WHITE spot, apply levels and set white point white spot in the bottom right
2

This is a common issue with scanned or photographed documents. The image can be readily improved with image editing tools.

In the example below, I used free IrfanView, a small Windows application that runs well under wine in Linux, but powerful, free GIMP which you've installed can perform that task, too. GIMP, being so powerful, is also complex and has a longer learning curve.

Edited score

This quick edit used just a few features, and certainly can be improved. Though the directions include IrfanView shortcuts, the same tools can be found in GIMP.

  • Open the file in the image editor.
  • Open the dialog(s) to adjust the following, and edit as needed. [In IrfanView, press ShiftG.]
    • Contrast
    • Gamma
    • Brightness
  • Likely, the image will print better if it is made monochrome (i.e., grayscale), and if the number of colors (shades of gray) is reduced. [In IrfanView, press CtrlG to make grayscale, and menu item Image | Decrease color depth for that dialog.]

Other ways to improve the image involve use of tools to rotate and flatten the image, e.g., Perspective Transformations .8bf extension for Adobe and IrfanView.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .