How do I get a line (path) look like this?

Post questions on how to use or achieve an effect in Inkscape.
robome
Posts: 2
Joined: Wed Sep 01, 2010 2:43 am

How do I get a line (path) look like this?

Postby robome » Wed Sep 01, 2010 2:53 am

Hi folks,

doing fancy and beautiful images isn’t my thing, I use Inkscape to do some basic graphics.
No I came across a raster graphic I’ve to redo as vector graphic. It basically is a line with steps:
Image

Sure I can create individual paths with varying thickness and fiddle them together. But maybe there’s a way to achieve this effect on one path without to much manual work (the shown is only an example of the quite long and tedious whole). Unfortunately neither height nor thicknes is constant.

Any suggestions are welcome.

Robert

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: How do I get a line (path) look like this?

Postby prkos » Wed Sep 01, 2010 5:53 am

Sorry I don't think you can use a single line there. Unless you need antialiasing and this is all one smooth line and not steps but because of the bitmap/vector difference.

I think this is possible with the SVG line element but AFAIK it's not implemented in Inkscape.

You can use subpaths though. Use Bezier tool (Pen) in straight line mode and create one horizontal line for each step, then combine them together (Ctrl + K), or hold Shift when drawing the next line to add it as a subpath to the previous one. The thickness seems to be the same so I think this can work.

You can also use grid and snapping to speed it up.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

vwanweb
Posts: 169
Joined: Sun Jun 06, 2010 1:48 pm

Re: How do I get a line (path) look like this?

Postby vwanweb » Wed Sep 01, 2010 12:25 pm

kind of blotchy but fast, you could try using Trace Bitmap. Select the image you want to use as the SOURCE of the trace.

then open the Trace Bitmap Menu.. >Path >Trace Bitmap... (Shift+ Alt+ B)

deleteTraceBitmap.png
deleteTraceBitmap.png (24.99 KiB) Viewed 1678 times
''

To get rid of the speckles, use this menu's OPTIONS tab and Check the [Supress Speckles] with a tolerance of ~3 to 5.

Uncheck the smooth corners options, your choice.. :), Click OK..

Not very clean but it is fast, select the new path and then run the new "Snap Pixels" option, >Extensions >Modify Path >PixelSnap. I had to zoom in on the path for it to kick in and work

robome
Posts: 2
Joined: Wed Sep 01, 2010 2:43 am

Re: How do I get a line (path) look like this?

Postby robome » Thu Sep 02, 2010 2:35 am

Thanks for all your suggestions.
I tried tracing the scan before and now did it again with your settings. Sadly the results aren’t much to my liking.
I drawing them all is quite heavy because they’ve to fit really neatly. But if you say there’s no other way in Inkscape, I’ll go with this.

User avatar
RobA
Posts: 335
Joined: Fri Aug 10, 2007 1:22 am

Re: How do I get a line (path) look like this?

Postby RobA » Fri Sep 03, 2010 2:10 am

To extend that, you can start with a simple path 1 px wide and aligned to the pixel grid/half grid (or use the pixelsnap extension).

Then copy and paste a bitmap copy.

And then use trace bitmap on the bitmap copy to get the outlines of the pixels.

-Rob A>

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How do I get a line (path) look like this?

Postby brynn » Fri Sep 03, 2010 8:18 am

Sorry I don't think you can use a single line there.

I think you could, but you'd have to be sure to use Fill Rule: Non-Zero. I don't know if you could use a grid or not, because I can't tell for sure, from your example image, if the lengths are all equal. But if so, it would be a simple matter, using Snap to Grid, with the Bezier tool in straight line mode, like so:

Image

Mr. R
Posts: 4
Joined: Fri Sep 03, 2010 1:03 pm

Re: How do I get a line (path) look like this?

Postby Mr. R » Fri Sep 03, 2010 2:00 pm

Well, this also works. But you'd need to have a fast CPU.

Go to Path > Path Effect Editor... or press CTRL+Shift+7
Make a square with the Rectangle Tool :tool_rectangle: on the top-right and have it as an outline.
Apply Construct Grid to the rectangle and make the Grid X and Grid Y fill the size of the paper.
Use the Fill Tool :tool_paintbucket: to fill in the squares, and delete the grid when you are finished.


Return to “Help with using Inkscape”