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 pen1 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 []

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

  1. Eran:
    Fatal error: Uncaught Error: Call to undefined function comment_dir() in /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/single-comment2.php:17 Stack trace: #0 /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/functions.php(8): include() #1 /vhosts/coil/geek/public_html/wp-includes/class-walker-comment.php(179): themed_comment() #2 /vhosts/coil/geek/public_html/wp-includes/class-wp-walker.php(144): Walker_Comment->start_el() #3 /vhosts/coil/geek/public_html/wp-includes/class-walker-comment.php(139): Walker->display_element() #4 /vhosts/coil/geek/public_html/wp-includes/class-wp-walker.php(387): Walker_Comment->display_element() #5 /vhosts/coil/geek/public_html/wp-includes/comment-template.php(2229): Walker->paged_walk() #6 /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/comments.php(26): wp_list_comments() #7 /vhosts/coil/geek/public_html/wp-includes/comment-template.php(1539): require('/vhosts/coil/ge...') #8 /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/single.php( in /vhosts/coil/geek/public_html/wp-content/themes/modern-bluish/single-comment2.php on line 17