2

I am using inkscape 0.92, and I have multiple pairs of objects that I want to partially overlap sort of like the following:

simplified view of objects

The objects involved here are depicted as ABC and DEF. The objects may actually be either textual or graphical, but denoting them in this way makes it possible to easily and unambiguously refer to specific objects.

As is apparent, I have an outline on DEF, and want that outline to obscure ABC. In particular, however, I want the outline to still effectively be transparent in the result, and reveal portions of any objects which might be on the page but below ABC. Essentially, in this diagram, everything that is depicted as white in this picture should actually just be transparent, and reveal any objects below.

I know could simply achieve this look, if I already everything exactly in the right position and nothing else was ever going to change, is make a duplicate of DEF, add the outline to it, convert its stroke to path, and then use Path->Difference on ABC to cut that path out from ABC.

However, the problem I have with this solution is that it leaves neither the top or bottom objects in each pair as "live editable". While it properly obscures the object underneath, I need to able to do things like adjust the positions of either of the objects, or change their textual contents, or make tweaks to their boundaries when the object is simply a path, and have the outline of the upper objects still properly obscure the specific objects below.

If this were the entirety of the drawing, I would simply use a white outline on each object, but of course, this hides objects underneath "ABC" as well, and I want them to show through the otherwise "white" parts of this.

Thanks in advance.

EDIT:

After I posted this question I noticed that the stroke of an object covers also a part of the fill area of the object. I must add the following new requirement:

DEF in the wanted construction is strokeless, the generated gap should't wipe off anything from DEF.

That unfortunately reduces the usability of the first three answers. Sorry for poor question and hopefully someone can also solve this edited case.

1
  • 1
    I added the new requirement to the question more clearly. Please revert, if this is not ok.
    – user82991
    May 14, 2018 at 22:54

3 Answers 3

2

That's possible. You can use masking ie. white parts of the mask make the masked object visible and black makes it invisible. Topmost text (your DEF) isn't editable in_place, you must edit its prototype, but the copy follows automatically.

here are the ingredients:

enter image description here

  1. the editable text with stroke, make two clones of it, you need them in objects 2 and 3

  2. a black rectangle masked with a clone of 1. (black isn't a must, any color goes)

  3. a group, on top there's a clone of 1 and just below there's a white rectangle

  4. a test shape, text ABC and a rectangle

NOTE: I have a locked grey background to make white parts visible.

Some operations more:

enter image description here

  1. text ABC is masked with group 3

  2. masked rectangle 2 is placed on the top

Final test 1: We edit shape 1 DEG to DEF

enter image description here

Final test 2: We edit ABC to VBH without releasing the mask:

enter image description here

Useful to keep in mind: You can easily select any object, even inside a group, in the objects panel. There you can also freely change their layering order by dragging objects upper or lower.

3
  • This is quite complicated, but to be sure I undertand, is the outline of an entity cutting into that entity itself, or does it only obscure objects below? That is, if the outline of DEF, above, were made thicker, would it appear to make the black strokes of DEF thinner? If so, that's not going to work.... I was assuming that the stroke would be under any fill, and hadn't thought that it might be relevant. I do apologize for not mentioning this in my original question, because your answer is very detailed and seems to generally do what I had asked (although I have not yet tried it).
    – Mark
    May 14, 2018 at 13:27
  • @Mark unfortunately in Inkscape half of the stroke is allways over the own fill of the shape and the other half is outside the fill. In illustrator stroke placement is adjustable, but in Inkscape it's allways half and half. In my construction the stroke wipes off also a part of DEF.
    – user82991
    May 14, 2018 at 21:30
  • Ah.... that's what I was afraid of. :( Alas, I need the object's outline to not overlap it. I'll edit the question a bit so this is clear.
    – Mark
    May 14, 2018 at 22:13
2

There are some great answers here already, but here's another simple method. Although it won't work with all colours, it works well with black filled and white stroked text.

Here I have a group made of two text objects filled black, and one also stroked white. Open the Objects panel, and set the group blend mode to "Multiply"

enter image description here

The text is live, and editable. The group can be moved. Also you can select the text in the group, edit it, or move each text object as required.

2
  • This is almost exactly what I would need.... Thank you! This is perfect for black objects, but I'm wondering if is there any live effect that can be added after the fact to change everything that is black within a group to some other single color? Thanks again.
    – Mark
    May 14, 2018 at 3:27
  • @Mark This technique is really only going to work with black text, and a white stroke. Your are going to have to do something with masks as shown in user287001's answer if you want different colours
    – Billy Kerr
    May 14, 2018 at 11:43
1

If you plan to export to PNG or to use the image on the web, where the users' browsers support filters, you could, for example, use the 'Light Eraser' filter (others may work, too, didn't test extensively).

In the screenshot, the blue objects are grouped, and have the filter applied to the group.

Light Eraser filter

2
  • 1
    Exporting to png would not be "live editable"
    – Mark
    May 12, 2018 at 18:22
  • 1
    The export comes after the editing in the file - this is live editable. I was meaning that this (just like the masking suggestion below) cannot be used in programs that don't support filters (or masks) and cannot be used for cutting/plotting, for example. For those uses, you will need to go the long route via path operations, when you're happy with the result (or making a bitmap copy of the filtered / masked objects and tracing that).
    – Moini
    May 13, 2018 at 2:39

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.