Converting a Phone Photo to Digital Line Art - Gimp Edition

Lots of people are jumping into the #fridayfiveminutemap   this week and posting phone snaps of their maps. A couple have asked how to take the picture of their map and clean it up a little. This mini tutorial should help with that. The basic idea also works for cleaning up scans, and the techniques are useful in a whole range of places.

The Photoshop version of this tutorial can be found here:

1. The Photo
Okay, so here's a photo I've taken with my phone of a drawing made with a ballpoint pen. When taking the picture, try to do the following:

• make sure there's lots of light.
This will decrease camera shake and noise and give you the cleanest end result. Note - your phone almost certainly has a white balance built in and will believe that the white paper should actually be a midtone. A picture that's 99% white will be read by your phone as over-saturated. Hence in this picture the map is mostly around 50% grey. There's not much you can do about this unless your phone is so advanced you can control it's white balance (surely only a matter of time...)

• try to make sure that the light is as even as you can get it.
Here you can see the bottom left of the image was darker. The more uneven the lighting, the harder you'll have to work later, so it's worth taking 5 mins to get this as even as possible.

2. First use of levels
So here I'm using Gimp. However any tool that allows you to adjust the levels in an image (even preview on the Mac - and all photo editing software) can do this. You may even be able to do it on your phone to some extent.

In Gimp I use the adjust levels command (Color->Levels). This brings up a histogram of the shades in the images. Here you can see a large block in the middle of the range - these are the paper tones. They should all be right up at the right hand end - in the white region. So, we start by moving the white marker (the white triangle) down into the block, and we see a lot of the areas of the image that should be white turning white. However if we go too far we'll see a lot of our pen lines start to disappear.

At this stage go as far as you can with the slider without losing your line art in the brighter areas. Then press okay.

3. Dealing with the non-uniform lighting - layer masks
Okay, so the top right looks pretty decent, but the bottom left is still mired in grey. We can't do a uniform adjustment because we'll lose detail the bright regions before we gain anything to the bottom left. The way to deal with this in Gimp is to create multiple layers. Duplicate the layer (right click in layers dialog -> duplicate layer), On this layer, repeat the Layers dialog, but this time move the white point further down to the left. You'll lose some of your line work in the brighter regions, but don't worry - we'll get that back later. Repeat this process again (duplicate layer, adjust levels) again so that in the last case you have the most over-exposed image (mostly white, with your line work only in the region that was previously the darkest corner of the photo). Here I needed to do this three times to get a set of layers that cover the whole image.

The key is that each part of the image looks right in one of your layers.

4. Combine the layers
So each layer is clearly imperfect on its own, but here we'll combine the three layers to Frankentstein one great image together. We'll do this with layer masks.

Pick the second layer and add a mask (Layer->Mask->Add Layer Mask) Then use the gradient tool (set to Foreground to transparent, with foreground=black) to mask out the areas of the layer that aren't what you want (too bright, too dark). Here I've masked out the top right and bottom left - you can see that in the mask thumbnails. Note that when it comes to masks, black means the layer doesn't show. White means the layer will show.

Repeat this for all layers and you'll get a combined image that has no overall cast from the shadow! Now I bet you see why I said you want to minimize any shadows when you're taking the picture. To finish off merge the layers - right click the layer and click Merge Down.

5. Play!
Once you have the clean line art, you can do whatever you want! Here I've turned the image into a multiply layer (so that only the black lines are visible) and placed it over a parchment background. Then I've darkened the sea and changed the colour slightly.

The whole process is pretty quick once you've done it a couple of times. Once you're happy with it, you can quickly snap a picture of a sketch (or your #fridayfiveminutemap ) and have a pretty digital map in 5-10 mins.

Let me know in the comments if you have questions.

#fmtips   #gimp   #map   #tutorial   #illustration  
Shared publiclyView activity