Inkscape.org
Beginners' Questions How to copy selection of sub-paths?
  1. #1
    ronburk ronburk @ronburk
    *

    [Windows 7, 1.0alpha2 (4ce689b25c, 2019-06-24)]

    Top half of drawing is an imported bitmap made from scanning paper. Bottom half is the result of Path->Trace Bitmap.

    The bottom half is one gigantic path though visually, obviously, it looks like a variety of separate objects. I would like to break it into a few smaller paths to operate on.

    Why? For example, some parts of the drawing benefit from a "Simplify" operation, some do not. The "Simplify" tool does not observe the current selection of nodes and operates on the entire path no matter what.

    Example: I want the big "T" to be a separate path (obviously it will contain many sub-paths). The only way I can see to do this is to make a copy of the gigantic traced bitmap path, then use node selection to delete everything but the nodes in the big "T". Repeat for every other separate path I want to end up with, then delete the original gigantic traced bitmap path.

    Ideally, I would have hoped to just use the node edit tool (F2) to draw a box around the "T", copy it, and paste it as a new path. Copy unfortunately doesn't pay any attention to node selection and just copies the whole path.

    Any better/easier way to get what I want?

    Foo
  2. #2
    Maren Hachmann Maren Hachmann @Moini

    Not really. What I usually do is duplicate and delete what I don't need.

  3. #3
    Maren Hachmann Maren Hachmann @Moini

    (one can use a boolean operation for the deletion part)

  4. #4
    ronburk ronburk @ronburk

    Thanks -- just wanted to make sure I wasn't missing some cool feature!

  5. #5
    Tyler Durden Tyler Durden @TylerDurden
    *

    Path>Break Apart ?

    Combine selected objects

    Copy/paste

     

     

    This might not be faster in this case, but for some...

  6. #6
    ronburk ronburk @ronburk

    I had done the Path->Break Apart, but naively assumed Combine would not really reverse the operation to a high degree of fidelity. That's worth seeing in action for its own sake. It's slow on thousands of nodes, but so is everything else. Thanks for posting that!

  7. #7
    Xav Xav @Xav👹

    I commonly deal with this issue for my 'Monsters, Inked' comic strip. These start with sheets of outlines, but each sheet might hold several characters or objects. These are then scanned and traced, but need to be split into separate parts to reposition them.

    The best/fastest method I've found is this:

    1. Duplicate the traced object (Ctrl-D) so that you've got as many copies as there are objects in the image.
    2. Draw a rough object over the first thing to extract. This can be as simple as a rectangle or circle, but may need a more complex closed path if your items are close together.
    3. Select the top copy and the path you've drawn, then use Path > Intersection. If you have a numeric keypad, then Ctrl-* is the fastest method (that's the default: you can change the shortcut if you don't have a numeric keypad).
    4. Repeat 2 & 3 for each object.

     

  8. #8
    ronburk ronburk @ronburk

    Thank you @Xav ! I was going to start a different question about how to fake a lasso selection tool for that very reason and you read my mind. If not a normal comic strip, I'm kind of creating "serial art" (has to end up 1200lpi line art for a traditional book printer) so I'm trying to sharpen the axe of my Inkscape skills to get faster, 'cause damn this takes a lot of time!  Do I remember that you once had some blog posts or something somewhere on workflow related to Inkscape? Can't seem to find them, so maybe I misremember...  Also, know of any other relevant writings by people who are scanning into Inkscape vector instead of the more traditional bitmap painting? Seems like you may be relatively unique in that regard. Thanks again for posting that tip!

  9. #9
    Xav Xav @Xav👹

    @ronburk Not blog posts, but over 7 years of a tutorial series in Full Circle Magazine. The full index of articles is still on the old forum: http://www.inkscapeforum.com/viewtopic.php?f=6&t=11981

    I'm not aware of anyone else specifically taking this approach. I wonder if you really need as much as 1200lpi - we've had our comic strips printed in multiple publications and have found that a PNG exported at 600dpi is sufficient. But of course it also depends on the size things are being printed at, as well as what your printer has asked for.

    Otherwise my only tips are:

    • As discussed above, using Boolean operations to cut parts out of your traced image is a lot faster than using the node tool.
    • Path > Simplify is not as useful as it could be. Firstly you can't select a subset of nodes to simplify, and secondly you don't get any fine control over the degree of simplification. The best you can do is apply it repeatedly in short succession if you want to simplify further - then be ready to Ctrl-Z back out when you've gone too far.
    • A sneaky alternative to Path > Simplify is to select your traced object and use Edit > Make a Bitmap Copy to rasterise it in-place. Then trace the bitmap copy. You'll often get fewer nodes than the original, but with less of the loss of fidelity that can come from Path > Simplify. It works better on some images than others.
    • If you do need to move nodes in the Node tool, remember that selecting a number of nodes then holding Alt as you drag one of them (usually from the middle of the selection) will move the nodes in proportion to their distance from the one you're dragging. It's harder to describe than to do, but is useful for smoothly 'sculpting' paths.
    • If you need to delete some selected nodes in the Node tool, just pressing Delete will adjust the remaining nodes to try to keep as much of the original shape as possible. Ctrl-Delete will leave the remaining nodes unmodified, tending to 'straighten out' the deleted section.
    • If you need a silhouette of your traced shape - handy for adding an overall outline, a drop shadow and other tricks - here's the easiest way to do it:
      1. Draw a rectangle that covers your traced object, and in a contrasting colour.
      2. Move the rectangle down below the traced object.
      3. Bucket fill the rectangle, outside your object.
      4. Change the fill colour of the bucket filled shape, for clarity.
      5. Path > Break apart on the bucket-filled shape.
      6. Delete the outside part of the bucket-filled shape, and the rectangle you drew in step 1.
      7. You're left with a silhouette of your traced object in far fewer steps than trying to create it from the original nodes.

     

    Hopefully that should help you a bit, but feel free to ask if you have any more specific questions.

  10. #10
    ronburk ronburk @ronburk

    > The full index of articles is still on the old forum

    That might be what I'm remembering -- off to download them all! (You had me at "The bewilderingly named 'Roughly Threshold' parameter").

    > I wonder if you really need as much as 1200lpi

    Here I feel my way, but:

    • I have the impression it's not an uncommon preflight requirement (or at least recommendation) for line art for web offset printers. And maybe a vague idea that some RIPS are using the resolution to auto-identify the line art, but maybe that's out of date.
    • Because I'll be dropping a few tens of thousands of dollars of my own bucks for a first book print run, I want to raise the odds that I can see how things will look (or at least awfully close) with my home 1200dpi B&W laser printer as I go.
    • No grayscale going this route, but if I sometimes want a dither to simulate gray, I can just use a few dither patterns generated by Photoshop, and 1200dpi gives me enough headroom to get OK looking patterns. Inkscape seems to nicely pass the 1200dpi pattern fill exactly unchanged into the 1200dpi png output (yay!). Not as smooth as if I were tapping into the full resolution of the book press' printer, but I'll claim the effect is an artistic choice in exchange for better odds that what I see is exactly what I'm going to get back from the printer :-) 
    • It's all scripted anyway, so I could switch to, e.g., 600dpi by changing a line of code; though that would probably produce a few glitches that would require drawing-level changes and maybe having to fix all the dither patterns that I try to use sparingly.

    > Path > Simplify is not as useful as it could be

    Also, I can never remember where/how to set the default degree of simplification. I *think* it's in there somewhere, but maybe I dreamt it. Do you ever go with the Simplify LPE instead? I wish there was a button in the Simplify LPE to "render", by which I mean really go ahead and modify the underlying path and discard the path effect. Then I could just tinker and commit when it looks good. I think.

    > A sneaky alternative to Path > Simplify

    At first I thought "wow, this went completely jaggy" as I looked at the preview when I traced the bitmap copy, but the end result was as you predicted. Not sure I know what's happening there in the intermediate, but I guess it comes out OK in the end.

    I need simplification for two reasons. a) really easy to get an out-of-control number of nodes making me spend more time with hourglasses and crashes than I care to and b) on a good day and on the right subjects it give me a pleasing smoothing effect, aka making my pitiful line art look less crappy. So, I'm actually looking to lose some fidelity in many cases :-).

    I still have to play with your other suggestions, which also anticipated some future questions.  Thanks for all the info -- really appreciate it!

  11. #11
    Xav Xav @Xav👹
    ronburk

    I wish there was a button in the Simplify LPE to "render", by which I mean really go ahead and modify the underlying path and discard the path effect.

    I don't usually bother simplifying anyway, so I don't use the LPE. But in terms of "fixing" or "rendering" the result of the LPE - you can use Path > Object to Path.

    ronburk

    At first I thought "wow, this went completely jaggy" as I looked at the preview when I traced the bitmap copy

    It's worth noting that there's a global preference for the trace bitmap copy resolution, which might have an effect on how jaggy it looks in the trace preview. I have mine set to 150, which is high enough for my needs (simplifying paths, and occasionally taking a copy of filtered objects so I can switch to no filters view without losing my references). But play around and see if a higher or lower value works better for you.

     

  12. #12
    ronburk ronburk @ronburk

    > But in terms of "fixing" or "rendering" the result of the LPE - you can use Path > Object to Path.

    This works great! Never would have thought of that.

  13. #13
    Maren Hachmann Maren Hachmann @Moini

    The simplify LPE, when applied via Pencil tool, actually has a button to 'flatten' the effect. Click on it right after drawing.

  14. #14
    ronburk ronburk @ronburk

    > The simplify LPE, when applied via Pencil tool

    Which is awesome. Although, maddeningly, the up/down buttons on the smoothing value work only once, after which the value is highlighted (selected if you like) and the buttons do nothing. True in latest release, fixed in alpha, AFAICT.

    OTOH, in the alpha version, the "flatten" toolbar widget may appear in one of two different places, or in both(!) depending on the "mode" selected. If you were expecting to see this widget (e.g.) on the right-hand side, you may get fooled into thinking it's gone. In the release version, the "flatten" widget blessedly remains in the same (and only one!) place at all times, AFAICT.

    alpha = 1.0alpha2 (4ce689b25c, 2019-06-24)

     

Inkscape Inkscape.org Inkscape Forum Beginners' Questions How to copy selection of sub-paths?