Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to clean a scan of handwriting?
#1
I'd like to clean up a short piece of handwriting (like a signature; see attachment). I found some kind of thresholding in Gimp, but ended up cleaning a lot with the eraser.

Could you please suggest an approach / tools that seems best to get a single color version of the writing only?

Ideally it should be the lines only, no stray dots, a fairly smooth edge of the written lines and in the end a single color stroke.


Attached Files Image(s)
   
Reply
#2
(01-07-2018, 06:28 PM)Gerenuk Wrote: I'd like to clean up a short piece of handwriting (like a signature; see attachment). I found some kind of thresholding in Gimp, but ended up cleaning a lot with the eraser.

Could you please suggest an approach / tools that seems best to get a single color version of the writing only?

Ideally it should be the lines only, no stray dots, a fairly smooth edge of the written lines and in the end a single color stroke.

Try this:
  • Layer>Transparency>Add alpha channel (we are going to play with transparency)
  • Layer>New layer and fill with white. Drag to bottom of stack
  • Layer>Mask>Add layer mask. Initialize to "Grayscaled copy of layer", and "Invert mask".
  • Then start the "Levels" tool, and click on the picture. At that point you will be working on the layer rmask
Then:

   

The white background that was add initially isn't stricly necessary (even if it gives you a better idea of how things will look). You can remove it an export to PNG if you want the
signature on a transparent background.


   
Reply
#3
I usually use the colourpickers in the Levels dialogue to define a white point and clean up scans.
Reply
#4
An alternative is "not-gimp" but center-line trace using Inkscape

Works well on that image creating a quite a minimal path.


.svg   dk.svg (Size: 1.88 KB / Downloads: 612)
Reply
#5
(01-08-2018, 09:44 AM)rich2005 Wrote: An alternative is "not-gimp" but center-line trace using Inkscape

you should change the join style to rounded, but i agree, the result is great
Reply
#6
(01-07-2018, 08:22 PM)Ofnuts Wrote: Try this:
  • Layer>Transparency>Add alpha channel (we are going to play with transparency)
  • Layer>New layer and fill with white. Drag to bottom of stack
  • Layer>Mask>Add layer mask. Initialize to "Grayscaled copy of layer", and "Invert mask".
  • Then start the "Levels" tool, and click on the picture. At that point you will be working on the layer rmask

Thanks! At first I got different results, but then I realized that Add Layer Mask has to be applied to the original layer.

What's a good reference to understand the Levels dialog for a beginner? I wonder why I got colors when I click on Channel Alpha.

Is there a trick to "emphasize" all pixels so that I can reliably tell whether there are stray pixels left in between the letter?
Reply
#7
2) See https://docs.gimp.org/en/gimp-tool-levels.html But I wonder how you got colors? Screenshot?

3) Little known: View>Display filters and add Contrast or Gamma to the panel on the right. This changes the way the image is displayed, but not the image itself. Click on the filter you added to display its settings.
Reply
#8
(01-13-2018, 10:56 PM)Ofnuts Wrote: 2) See https://docs.gimp.org/en/gimp-tool-levels.html But I wonder how you got colors? Screenshot?

3) Little known: View>Display filters and add Contrast or Gamma to the panel on the right. This changes the way the image is displayed, but not the image itself. Click on the filter you added to display its settings.

Oh, you get colors (yellow) when you add the layer mask to the wrong layer (the background), then open the levels tools on the correct layer and click "Channels Auto". My fault.
Reply


Forum Jump: