1

I'm very new to Inkscape, and I'm sure I'm missing something trivial. I had a .png image with some lineart that I wanted to vectorize. I know how to vectorize lineart as to have black vectorized lineart, but for this one I needed two different colors for the lineart. The original image is grayscale, I'm the one adding the color. I looked it up and found a tutorial that seemed to give me what I wanted so I followed the following protocol :

  1. Opening my .png image with inkscape
  2. Selecting the lineart by clicking on it (do remember that since I'm a newbie, there are a lot of things that I do because I know it works, even if I don't know how it works)
  3. Clicking Path -> Trace Bitmap -> Brightness cutoff with whatever threshold worked for me -> Ok
  4. Selecting the old image below the newly created path, deleting it.

Now comes the part I'm not familiar with, because usually after this I have the .svg file of my black lineart on transparent background.

  1. Selecting my newly created path
  2. Clicking Path -> Break Apart

At that point, all of my closed paths became filled with black, which I thought, fine, whatever, I can just fill it with white. So then I :

  1. Select the lineart paths I want in color and fill them with color
  2. Select the paths that where previously transparent, and fill them with white.

I'm sure you see where I'm going : after that, I had my lineart with the colors I wanted, but some parts were filled with white, and I'd actually want them transparent. I've tried looking that up to. I have tried :

  1. To select the path, and press 'delete', but it appears black afterwards
  2. To put the alpha value to 0%, but then it also appears black

I'm putting some pictures to illustrate :

inkscape_alpha_100

On this one, you can see at the bottom that the alpha value is at 100%

enter image description here

On this one, you can see that by decreasing the alpha value, it actually gets darker instead of transparier.

I'd add the picture of the preview so that you can see that some parts are filled with white and some are not, but I'm limited to two pictures.

2
  • Ro be honest you can actually get a 3d model as lines. All you need is freecad and you can get robot models from jsut about any vendor.
    – joojaa
    Jul 5, 2019 at 15:18
  • I can. I'm pretty sure, though, that at some point, I will want to do the exact same thing with a drawing of lineart that is not from a technical drawing, so my question stands for future applications as well. Advice duly noted ! Jul 6, 2019 at 12:39

2 Answers 2

2

When you trace the bitmap, try using the "Remove Background" option in the Trace Bitmap dialog. This will give you a vector trace which has no white fill, only black filled outlines. The insides will be transparent.

Once you have such a trace, instead of breaking apart*, which seems to be causing you unexpected problems, try drawing filled blocks of colour with the Bézier tool, and arrange them under the transparent drawing in the stack. Then you'll be able to alter the opacity of the colour as normal.

For example:

enter image description here

You can send objects up or down the stack using the following shortcuts: Lower to Bottom is End. Raise to Top is Home. To move up or down one step at a time use PgUp or PgDn.

*Note: I wouldn't recommend breaking apart complex traces. It will cause you no end of problems trying to fix them.

2
  • Thanks ! Although I found easily the remove background, I tried figuring out the Bézier tool, and no such luck. If I have one big path, how to I customarily break it down in separate paths ? (I do understand if that is another question in itself that you don't want to answer here, or if that you think that should just RTFM.) Jul 6, 2019 at 12:40
  • @JambonSama - there are really good tutorials on youtube showing how to use the Bézier tool in Inkscape. Try one of these
    – Billy Kerr
    Jul 6, 2019 at 17:26
1

Your problem:

In Inkscape traced lines are not simple curves. Even the thinnest curve is a closed area with a fill color. Remove the fill color, add a thin stroke and see it by yourself. All lines will get doubled.

The empty interior areas are in many cases made as combined paths. If you break it apart, you get the outline and the inner shape which had made the hole when the paths were combined.

An example:

enter image description here

1) A bitmap image; it's image823 in the objects panel

2) the image as traced to vector (path825)

3) a duplicate of 2 but the fill color is removed and a thin stroke is inserted.

4) a duplicate of 3 after breaking it and moving the parts a little apart. The result is two paths (path829 and path833) If version 2 were broken apart, the resulted paths would both have black fill color

I guess you want simple paths because you want to adjust line width, its style and you here and there need faint fill colors for better legibility. It's easy in a text to refer a part with its color.

In some cases you can simply remove the inner shape, remove or change the fill color and insert a stroke, but often the result will not look out right. That's because the stroke is half of its width in a wrong place. If you search a little, you'll find plenty of tricks to create the missing midline. One of them is to apply Path > Dynamic Offset to the outer or inner part of the broken combined path. That unfortunately creates often a messy knot in a corner. You must convert the Dynamic Offset effect to path and remove some nodes with the node tool. A example:

enter image description here

In the left there's the parts of a broken apart combined path. In the middle the blue curve is a copy of the inner shape with effect "Dynamic Offset". You see a knot and several stray dots which all need to be deleted with the node tool. The fix is done in the right.

If you need filled areas for better legibility and you must use Inkscape's tracing, you can do as user Billy Kerr said and insert shapes at the bottom. Those shapes can in simple cases be the outer shapes of the broken apart results of the tracing. But some of them surely must be drawn. To control line styles and widths you must have simple strokes.

One possiblity to get midline traces is to use other software. Illustrator has it and it even works if the lines are narrow. Corel draw has it, too. You can also use software which is intended to vectorize scanned CAD drawings. Check this old case about that subject: Tracing a raster image to simple paths with stroke but no fill

The best option is to get vector images originally, as user joojaa suggested. Some CAD programs can save scenes of 3D models as vectors and some can print a "wireframe hidden lines removed" -scene as vector PDF. That PDF can be opened in Illustrator and Inkscape for edits. In inkscape you probably must do a deep ungroup, but that's a single click.

Ask ready to use vector drawings which don't need tracings! Or do as already suggested, learn to make them by yourself from 3D models. It's common that 3D models of components and machines are available - not as structured manufacturing models, but as geometry models for building the models of the installations and user's quides.

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.