Scanning Hand Written Texts Into High Quality Digital Files

The purpose of this exercise is to convert a hand written note – such as your signature – to high quality digital files that can be used to embed “hand write” into documents – such as when someone asks you to fax them a “signed” copy of the PDF they emailed you. You’d be surprised how often that happens around here.

Required Ingridients:

  • A computer with The GIMP installed
  • Your handy smart phone with a 5MP or better camera
  • A good pen and paper.

So anyway, here’s the process from top to bottom, with pictures:

  1. Sit down at a proper table, and using a good black heavy-line pen(1) on a white clean high-density paper, write what you need to write – slowly and deliberately but without pauses. Try not to smear the ink so you get clean continuous lines, otherwise the quality suffers a lot.
  2. Now take your phone and start the camera app. Make sure that flash is on (not auto – always on), and if your camera supports it, set the “auto focus” mode to “Macro”. Position the camera close to the paper so that it sees your whole text and hold the shutter button (don’t release it yet) to let the camera focus. If you don’t get a clean focus then don’t take the shot, move the camera a bit away and try again until you get a clean focus.
  3. After the picture is taken, load it into the computer. This part is usually the most complicated part of the whole process. On my phone I have “Google Docs” app installed, so I “Share” to “Docs” and I then use the browser to go to Google Docs and download the image file.
  4. Now its time to start GIMP, load the picture and do the magic:
  5. The first tool to use is the “Crop” tool from the toolbox – we need the image contain only the actual hand written note we want to convert, and specifically we need to get rid of the edges of the picture where the flash didn’t highlight the paper well (because the camera was so close to the paper

    The “Auto Shrink” feature is normally very useful for these kinds of jobs, but because of the inherently “noisy’ background of the paper, it wouldn’t work at all – just do your best manually and leave a bit of margin around the text. When you’re done setting up the box around the text, then click the center of the selection to make the crop.
  6. Next we need to clear the image of most of the background noise of the paper before the real work can begin – to do this we will use the popular “Unsharp Mask” filter

    When the “Unsharp Mask” dialog comes up, push both the “Radius” and “Amount” sliders all the way to the end, while leaving the “Threshold” value at its default small value (I usually set it to 5, but any small number will work fine)

    After you apply the filter, the image would look drastically different, as you can see in the example below, but we’re not done yet

    If you look closely you’ll see that there are still some color artifacts present. In this example the photograph source is of rather high quality, but with less high quality input you may still see here some blobs and spots which should get taken care of by the next step.
  7. To completely separate the hand written text from the background, we will use the “Threshold” command from the “Colors” menu – this will highlight in black only the ink from the photograph and will clear everything else to white. When the “Threshold” dialog opens, click the “Auto” button to automatically select the correct threshold value.

    At this point we are basically done with the major part of the work. We need only prepare the image for embedding and possibly due a bit more clean up if the original wasn’t of a good enough quality and we still got some black blotches where there shouldn’t be any.
  8. The next step is to remove the white background from the image so it can be later embed the image into another document without having a white box around the text, that hides whatever we were supposedly “writing over”. From the “Colors” menu select the “Color to Alpha” command and apply its default setting (which should be to have the color White converted to transparency)
  9. If we still got some inky looking blotches, left from the previous stage that we want to remove, you can clean them up manually by adding a layer mask

    And set it up to start completely white (opaque – which is the default)

    Once that is done – and you can see the layer mask as a white box to the right of the layer preview in the layers tab, take a paintbrush from the toolbox, and touch it to where you have noise that you want removed, careful not to touch actual lines

    Finally apply the layer mask by right clicking the layer in the layers tab and selecting “Apply Mask”
  10. The last step is to save the result as a PNG file – so that we keep the transparency of the background.

The new image is now ready for import into your PDF editing software of choise, or into any other document where you need to fake ink on paper. You can also, obviously, keep the digital file and use it many times without bothering your hardware (pen, paper and camera) again.

Good luck.


  1. in this shot I used a 0.7 permanent marker – which is just overdoing it – probably any 0.7 pen will work []

5 Responses to “Scanning Hand Written Texts Into High Quality Digital Files”

  1. Eran:

    I didn’t know you also did graphics.
    It’s a good idea and I should really do that next time I plug in my digital writing pad.

  2. Oded:

    I dabble from time to time. If you have a digital tablet, then the whole procedure is kind of pointless – just get a good paintbrush and write out what you need directly on the GIMP canvas.

  3. Discovering Your Blog Layout Style:

    […] Jen took some more photos of me being more “myself.” I learned how to make this brush-pen logo from Coco Mingo and this tutorial for scanning hand written text.  […]

  4. Shubham:

    I have the handwritten scanned copies of notes in pdf format but they are of very bad quality, so please suggest me how can I improve the quality of material ( blurred and not clearly visible ).

    • Oded:

      I’m thinking you can import the PDFs into gimp, apply unsharp mask, denoise and threshold – and that should have better quality. But if expect you’d still need to do some cleanup by hand.

      I’d like to see a sample, maybe I can help with the process.

Leave a Reply

 

 


Spam prevention powered by Akismet