53

I'm editing an svg in Inkscape and I have an object on top of another object. I'd like to use the shape of the top object to cut the object beneath it.

For those who are familiar with GIMP, I'm trying to do something like the "alpha to selection" tool.

39

Select both (by clicking one object, holding shift, then clicking the other object), then select Path, then Difference.

For me, I wanted to cut a left arrow out of a hexagon. I created a hexagon, duplicated the layer, shifted the top layer to the right, then selected both layers, then PATH / Difference.

  • 4
    Adding to this: I wanted to cut out text, so first I had to select the text, Path > Object To Path, then select again and Object > Ungroup, then select each letter and the background individually - you can only ever do this with two objects at a time. – SinisterBeard Aug 11 '15 at 11:28
  • You can actually do this with more than one path at a time thanks to a new extension: github.com/Moini/inkscape-extensions-multi-bool – johnp Jun 13 '16 at 3:37
  • It doesn't work. At all. Nothing happens. – yPhil Jul 19 '18 at 12:42
  • 1
    @yPhil the remark by SinisterBeard helped me to make it work. Have you tried that? – thymaro Sep 11 '18 at 14:29
18

Select Both and Do:

Object --> Clip --> Set

  • 2
    This should be the accepted answer. – TenLeftFingers Nov 5 '16 at 22:10
  • 4
    This always comes out opposite of what I want. Maybe because the object on top is the bigger one? Also doesn't work, if the "cut out" part is supposed to be transparent. The color of the object in the back will show up. – DanMan Mar 20 '18 at 15:25
  • @TenLeftFingers this is only true if you want the lower object to have the shape of the top object. If you want the shape of the top object be cut out from the lower object, then it shouldn't. The question is actually ambiguous, if you don't know GIMP and its "alpha to selection". I looked it up and I don't think it clears it up, to be frank. – thymaro Sep 11 '18 at 14:18
4

Select both, PATH >> INTERSECTION

  • 8
    If you are trying to subtract a thick line (stroke) from a shape you will have to choose PATH >> STROKE TO PATH first. – Adripants Feb 4 '14 at 23:46
3

I wanted to cut a cross shape out of another shape. I used the original shape.svg and another image, cross.svg (which was the exact shape I wanted to cut out). Now, I tried all of the suggestions here, but none of them worked and after much experimenting, I found an easy approach which I hope will work for others.

  • open inkscape
  • open shape.svg
  • import cross.svg
  • resize and position cross.svg over shape.svg in the place where the cross needs to be cut out
  • Path --> Combine (this resulted in the original shape.svg with a cross cut out of it)
  • After the combine, the shape.svg was the color of the cross.svg, so I just selected it and chose the color I wanted from the fill palette
  • File --> Save as

I would note that both images were one color to begin with.

3

A little(?) late to the party and wondering why no one mentioned division (Ctrl+/).

The top object must be duplicated or else you will be left with the bottom object in two segments - one will be in the shape of the top object and second will be the residue

  1. Select the top object.
  2. Press Ctrl+D to duplicate it.
  3. Change the color so that it's discernible
  4. Press Shift and click the bottom object. (You must have a copy of top object and bottom object selected by now. Check the status bar to see if only two objects are selected.
  5. Press Ctrl + /

You now have the top object AND the bottom object in two segments.

HTH

  • Division is for paths, not objects. Not all objects can be converted into paths. – DanMan Mar 20 '18 at 15:24
1

Three years later and I've had the same problem. I downloaded a vector sheet filled with multiple objects to be used. I only wanted one object off a sheet of ten. So I wanted to cut and paste that object into another svg file I was working on. Here's what I discovered and how I did it.

The original svg file with multiple objects on it was a single layer. You MUST create a new layer in order to do this otherwise nothing will work.

Create a new layer above the original layer, while in the new layer create a shape over the object you want to cut out. I used a rectangle with no fill and a solid stroke so I could see it around the object I wanted.

Select Path, Intersection.

Now go back to the original layer where your object resides, otherwise you will just cut and paste your rectangle instead.

Put your cursor over the object (In selector mode) and the object will now move independently of the original image.

You can now copy and paste this object into another file and it will retain it's attributes.

The biggest difficulty with Inkscape is getting the processes of GIMP or other image editors out of your head because this program needs a different approach. Instead of just using a selection tool then copy and pasting. You need to create a selection mask with a new layer and the shape of another object. Then the intersection tool will create a clipping mask for you.

0

Apparently, Inkscape booleans do not work with grouped objects. Ungroup the object to be cut off, then select the objects, and then path/ and (example) cut path.

0

Ungrouping objects, selecting all points and choosing Path >> Exclusion worked for me.

See YouTube video: https://youtu.be/uquoIZhyarQ

  • 1
    Welcome to GD.SE! Can you please explain better your solution, for example by adding screenshots and explanation what they show ... – Mensch Apr 28 at 13:04
  • @Kurt, Even better, how about a video? – Jay Apr 29 at 17:45
  • 1
    I personally do not like videos, my experiance with them is not good (to mutch errors, not fitting the searched solution etc.). I prefer a written solution, which can directly be proofed and one needs no internet connection to a hopefully not broken link ... Images and text are mutch more valid for this web page I think. – Mensch Apr 29 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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