Vectorize a map

Post questions on how to use or achieve an effect in Inkscape.
Sverre
Posts: 3
Joined: Thu Mar 27, 2014 1:30 am

Vectorize a map

Postby Sverre » Thu Mar 27, 2014 2:04 am

I scanned a map from a book in .tif format, and modified it quite a lot in GIMP (probably using the wrong tools, as it was my first time using it).

Now I would look to vectorize the map, primarily because I want to add text to the picture (specifically, I want to add city names to the filled circles in the map).

What is the first step I should make here? After exporting the map from GIMP in .png format, I tried to use Path > Trace Bitmap (using the default settings), but all of the lines in the map remain part black and part white (similar to how they are in the original .tif file), instead of being filled. I think a reasonable first step should be to make sure that all the black lines and dots in the map become filled. How can I do that?

I think the map should be shrunk, but I don't know if this is something that should be done before or after vectorizing it. I'm open to suggestions and any other help.

blighty
Posts: 13
Joined: Wed Jan 29, 2014 7:30 pm

Re: Vectorize a map

Postby blighty » Thu Mar 27, 2014 4:11 am

Firstly: Do you need to vectorize the map? You can keep it as a png, add a new layer above the map, then put the names on the new layer.

Secondly: Your map is not truly black. In Gimp, select some black with the Colour Select tool. Now Grow the selection by 1 pixel (Select>Grow). Finally, bucket fill the selection with black. Your map will now be truly black.

If you vectorize your map, you get about 150,000 nodes. If you first use Gimp to make the map truly black, the number of nodes comes down to about 15,000. Still a lot, but better than 150,000.

Sverre
Posts: 3
Joined: Thu Mar 27, 2014 1:30 am

Re: Vectorize a map

Postby Sverre » Thu Mar 27, 2014 4:15 am

One: Your objection makes a lot of sense. I wasn't even aware of such an option. I'll see if I can manage to add a layer.

Two: Will give that a shot too!

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Vectorize a map

Postby hulf2012 » Thu Mar 27, 2014 5:09 am

Hello,
The Trace Bitmap tool is good, but for your case I think you should try to trace by hand your map, using the pen tool: :tool_pen:, and later using the node tool :tool_node:

It's hard for me to explain this: The Trace Bitamp Tool generates Shapes, not strokes. Because of that, It generates a lot of nodes. Tracing by hand your map, you will get an stroke foe each line.

http://tavmjong.free.fr/INKSCAPE/MANUAL ... ating.html

Later that strokes can be changed its style, making discontinuos lines, pointed lines etc... or even special kind of stle lines using Live Path Effects:

http://tavmjong.free.fr/INKSCAPE/MANUAL ... gPath.html

Or maybe, as been pointed before, you don't need to vectorize all your map
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

Sverre
Posts: 3
Joined: Thu Mar 27, 2014 1:30 am

Re: Vectorize a map

Postby Sverre » Thu Mar 27, 2014 6:08 am

blighty wrote:Secondly: Your map is not truly black. In Gimp, select some black with the Colour Select tool. Now Grow the selection by 1 pixel (Select>Grow). Finally, bucket fill the selection with black. Your map will now be truly black.


I didn't get this to work, actually. When I tried to bucket fill the selection, it only fills that extra pixel border along all the lines. All the randomly spread white pixels inside these areas are left untouched. But I guess I should address this in some GIMP forum ...

rich2005
Posts: 55
Joined: Fri Mar 30, 2012 9:06 pm

Re: Vectorize a map

Postby rich2005 » Thu Mar 27, 2014 8:02 am

The problem with the image is that it is 1 bit (black and white) and indexed.

You can improve it in Gimp for use in Inkscape by
Change the mode to RGB (in the gimp image menu)
Apply the erode filter (filter - generic menu) to shrink the white pixels. Since the gray is virtually a black/white 1 pix checker the white shrinks to nothing.

http://i.imgur.com/qtaj2No.jpg

But I agree with previous posts, not a nice image to vectorize.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Vectorize a map

Postby Lazur » Thu Mar 27, 2014 10:51 am

Looks promising.

By editing it a little more in gimp you can make it quite good for vectorising it in inkscape without tracing the whole thing over manually.

Here is how I would starting off with auto-tracing:
https://dl.dropbox.com/s/rttq2s3usr25q1w/hlp125.xcf

I would auto-trace three layers of that xcf, then
use the method described by Brynn here to shrink the lines http://www.inkscapeforum.com/viewtopic.php?f=5&t=13929,
edit the thinner ones manually;
use the pattern along path live path effect on the other,
and replace the dots with circles.


Edit:

Here is what could be achieved with those.

SVG Image

The paths where marked with blue needs some revision, other than that it is quite ok.


Return to “Help with using Inkscape”