2

here's a map of a country with a red border: https://upload.wikimedia.org/wikipedia/commons/1/13/Congo_Kinshasa_Topography.png

i've imported the .png and now want to clip it to just show what's inside the red border.

tracing results in a huge complicated mess of paths and nodes that basically cause inkscape to hang when i try to intersect/difference them with pencil-drawn paths to try to isolate the border.

i feel like i must not be approaching this correctly, what's the right way to do it?

4 Answers 4

1

Hi there and welcome to GDSE.

As you might know the image you have is a raster image which consists of pixels.

Inkscape is a vector drawing application. You can place/import raster images, but you can't directly manipulate the pixels.

As you have experienced your image is way to complicated to do an automated trace.

I recommend you to do one of the following:

  1. Open the image in a raster image application (Photoshop, GIMP etc.) and erase/mask the unwanted area manually (there are many different ways to do this).

  2. Use Inkscape to manually trace the contour using pen tool and then use this shape as a clipping mask for the image.

  3. Find another similar image in svg format (which is a vector based format). Open it in Inkscape and delete the unwanted paths.

1
  • the image isn't too complicated for a trace, see my answer. i just had to experiment with the trace options a bit. Oct 10, 2018 at 0:21
1

The red border is part of the PNG. It's not a vector, so you can't use it as a clipping mask. It's not possible. Inkscape is a vector image editor.

However it is possible to add a vector clipping mask to a raster image in Inkscape. But the process is manual, and involves drawing the clipping mask manually.

  • Create a closed path with the Bézier tool, around the area you wish to clip.
  • Select both the path and raster image
  • Click Object > Clip > Set

Here's a quick example. I have drawn a closed shape filled with semi-transparent orange so you can see it. I select both the raster and the path, then clip it.

enter image description here

1
  • i want an exact clip, as automated as possible. see my answer, it is possible, i just had to understand trace options a little better. Oct 10, 2018 at 0:22
1

a color multi scan trace isolates the red (i used 24 colors but i think you could use less). i found the red one, moved it to another layer, and deleted the rest. then i broke it apart, found the resulting path for the contiguous border, moved it to another layer, and deleted the rest. since the border isn't a closed path (there's a little opening at the coastline), i then had to use the pencil tool, path intersection/difference operations, and another break apart, etc, to get rid of extraneous nodes. then a linked offset, edited its radius to -0.5 in xml editor, and i had a perfect clip.

1
  • this stack exchange requires me to wait to accept this answer, but as far as i know this is the most exact and automated method. Oct 10, 2018 at 0:23
0

On the page, where your PNG can be found, there is a SVG file too, two pictures above.

I would download this one, and see, whether the details are fine enough for my needs.

1
  • Thanks, but I'm interested in keeping the topography information in the png Oct 24, 2018 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.