How to cut photo along the borders of a vectorial obkject

General discussions about Inkscape.
ef91
Posts: 8
Joined: Mon May 22, 2017 7:41 pm

How to cut photo along the borders of a vectorial obkject

Postby ef91 » Mon May 22, 2017 8:31 pm

Hi everyone,

my name is Enrico, I'm 25 years old and I work for a web agency in Italy.

Thank you for your time in advance, I appreciate everyone who's kind enough to share his/her knowledge about this.


I would like to crop an image along the lines of a vectorial object. How would I do it?
I've already tried to adapt this solution (https://design.tutsplus.com/tutorials/quick-tip-what-are-clipping-and-masking-in-inkscape--vector-24947) but it doesn't seem to work.

The image attached is what I'm working with
Schermata 2017-05-22 alle 12.10.21.jpg
Schermata 2017-05-22 alle 12.10.21.jpg (194.17 KiB) Viewed 4521 times


Thank you
E.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to cut photo along the borders of a vectorial obkject

Postby Moini » Mon May 22, 2017 11:12 pm

Hi Enrico,

what is the result you want to achieve? Cut a hole into the photo, in the shape of the beige grass?
Try a mask:

- Cover the whole photo with a white rectangle. This will need to cover all the parts that you want to keep.
- Make your 'grass' black. This is required for making things transparent.

- group the rectangle and the grass. Make sure the group is at the top.
- Select photo and mask group. Do Object -> Mask -> Set.

Example svg file:
https://framadrive.org/s/cjMbVAzoRaBCl7h

Screenshot:
Image

Kind Regards,
Maren
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

ef91
Posts: 8
Joined: Mon May 22, 2017 7:41 pm

Re: How to cut photo along the borders of a vectorial obkject

Postby ef91 » Tue May 23, 2017 12:07 am

Hi Maren,

thank you for helping out.

The problem with regular shapes is that it won't allow to follow the left border of the curl.
Because if I place a rectangle starting from the deepest section of the curl it'll cut a portion of the top at the right side of the curl (where I'd like to keep the photo intact).

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: How to cut photo along the borders of a vectorial obkject

Postby tylerdurden » Tue May 23, 2017 12:32 am

Maybe this?
Image
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: How to cut photo along the borders of a vectorial obkject

Postby theozh » Tue May 23, 2017 12:41 am

@ef91, sorry, it's still not clear to me what you want to achieve.
Do you want to remove/hide everything of the photo which is to the left side of the left border of the curl but leave all the rest?
Which parts of the image should disappear and which do you want to keep?
Win7/64, Inkscape 0.92.2

ef91
Posts: 8
Joined: Mon May 22, 2017 7:41 pm

Re: How to cut photo along the borders of a vectorial obkject

Postby ef91 » Wed May 24, 2017 12:32 am

sorry theozh maybe I was explaining myself wrong but tylerdurden got it right.
That's exactly what I needed. I needed to only delete the part of the photo that is on the left side of the curl.

Thank you very much
E.

ef91
Posts: 8
Joined: Mon May 22, 2017 7:41 pm

Re: How to cut photo along the borders of a vectorial obkject

Postby ef91 » Wed May 24, 2017 12:48 am

tylerdurden wrote:Maybe this?
Image


the only problem is that, after I duplicate the vectorial element, I don't get the option to click on "Pop selected groups..." in the Object menu.
Is there any other path where I can find that function?

Cause when I drag one of the nodes, it only moves that node.


E.

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: How to cut photo along the borders of a vectorial obkject

Postby Xav » Wed May 24, 2017 1:47 am

I think tylerdurden might be using a development copy of Inkscape, as that menu option isn't present in my 0.92 either.

The solution is to do the following after duplicating:

1) With the duplicate still selected, use Edit > Cut
2) Exit the group (right-click > Go To Parent)
3) Edit > Paste in Place
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

ef91
Posts: 8
Joined: Mon May 22, 2017 7:41 pm

Re: How to cut photo along the borders of a vectorial obkject

Postby ef91 » Wed May 24, 2017 2:11 am

Xav wrote:I think tylerdurden might be using a development copy of Inkscape, as that menu option isn't present in my 0.92 either.

The solution is to do the following after duplicating:

1) With the duplicate still selected, use Edit > Cut
2) Exit the group (right-click > Go To Parent)
3) Edit > Paste in Place


Right click on the vectorial element or anywhere on the white frame?

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: How to cut photo along the borders of a vectorial obkject

Postby Xav » Wed May 24, 2017 2:19 am

You could have tried both in the time it took to write the question. In practice it doesn't matter - you're "inside" the group at that point, and wherever you right-click the "Go to Parent" option will take you back outside the group.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

ef91
Posts: 8
Joined: Mon May 22, 2017 7:41 pm

Re: How to cut photo along the borders of a vectorial obkject

Postby ef91 » Wed May 24, 2017 2:41 am

Xav wrote:You could have tried both in the time it took to write the question. In practice it doesn't matter - you're "inside" the group at that point, and wherever you right-click the "Go to Parent" option will take you back outside the group.


If I asked it's because I tried them both.
Point is that I don't get any of the options you guys are mentioning.
I never did graphics before nor I've ever touched inkscape before.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: How to cut photo along the borders of a vectorial obkject

Postby tylerdurden » Wed May 24, 2017 5:19 am

To exit a group, I usually just double click outside the group.

Paste in place is also a good way to move the object out from the group. IIRC, Pop selected object is a new feature in 0.92.1.


I'm using the stock Win install of 0.92.1.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

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

Re: How to cut photo along the borders of a vectorial obkject

Postby brynn » Wed May 24, 2017 9:38 pm

I have the "Pop selected objects out of a group".... menu item in 0.92.1, which is the current stable version.

However, it doesn't seem to work like it sounds. It sounds like it would just take the selected object out of the group. But it doesn't seem to do that for me. It actually doesn't seem to do anything.... Maybe there's something in Preferences that needs to happen, to enable it? Although a quick look, I didn't find anything.

I think you might be confused because tylerdurden grouped the swish object with the photo, before he started the animation. It can be a little tricky for newbies to select an object out of a group or enter a group or other similar things. (Heck, I get confused entering a group myself!) This might be a little easier.

-- Select the swish object and do Edit menu > Duplicate (Only duplicate if you want to have that swish object showing after you finish clipping. If you don't need it, don't duplicate.)
-- Switch to the Node tool :tool_node: and click on the swish object, if it's not already showing you the nodes.
-- Drag the nodes on the right to the corners on the right, like in tylerdurden's animation. It's ok to drag them one at a time.
-- Switch back to the Selection tool :tool_selector:
-- Drag a selection box around both the photo and the swish object (selects them both)
-- Object menu > Clip > Set

-- If you did duplicate the swish object, now you can group it with the clipped photo. Drag a selection box around both the photo and the swish, and do Object menu > Group. If you didn't duplicate it, you're done.

Grouping is important if you want to keep the swish object aligned with the photo. They are still separate objects, but when they're grouped, they act like one object. So they'll move around together when they're grouped.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to cut photo along the borders of a vectorial obkject

Postby Moini » Fri May 26, 2017 4:27 am

The option moves the object one group up, so it will become a sibling of the group that it has formerly been a part of. It's also available in the right-click menu for any object that is inside a group.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

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

Re: How to cut photo along the borders of a vectorial obkject

Postby brynn » Fri May 26, 2017 12:41 pm

I don't understand, Moini. Do I need more than one group for testing it?

When I test with just one group, it does absolultely nothing. I even opened Objects dialog to see what it does, but it doesn't even move it to the top of the z-order within the group. It certainly doesn't move it out of the group it was in.

Could be bug?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to cut photo along the borders of a vectorial obkject

Postby Moini » Fri May 26, 2017 10:12 pm

Works for me:

Image
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

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

Re: How to cut photo along the borders of a vectorial obkject

Postby brynn » Sat May 27, 2017 8:43 pm

Ooohh, I didn't realize you had to enter the group to do it! As long as I enter the group, it works just fine. But Ctrl + click, to select an object in a group - that does not work.

To me, it would be more useful if you could do it without entering the group. I mean, if I'm going to pop it out of the group to make it easier to select, and I enter the group to be able to select it, I'm already there and I can select it. Now I don't need to pop it out of the group. I don't expect I'll be using that much.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to cut photo along the borders of a vectorial obkject

Postby Moini » Mon May 29, 2017 1:19 am

Yes, makes sense, Brynn. Maybe a feature request?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

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

Re: How to cut photo along the borders of a vectorial obkject

Postby brynn » Tue May 30, 2017 2:27 am

Hhm, maybe....

Now that I think about it, I don't find myself needing to take one object out of a group, as much as I need to put a single object into a group. I guess once in a while I'll duplicate something without realizing it was in a group. Then it would be nice to "pop it out". I think I won't make a request at this time. But if I find myself using it, or needing to use it more often, maybe I will.

I wonder if ef91 ever got the technique to work?

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: How to cut photo along the borders of a vectorial obkject

Postby flamingolady » Tue Jun 20, 2017 12:20 pm

I realize this thread is a bit old, but in case he comes back, I wanted to give another method, possibly easier for a newbie (or me, lol). Just add the photo as a pattern, then it can be manipulated into any shape you want, and you can always go back and adjust it, in case the boss doesn't like it!

Complete Instructions:
Select the photo, click on the Objects tab, Choose Pattern, then Objects to pattern. Make an empty rectangle the same size as your photo, chg it to a path. You can move the original photo to another layer and hide it. Select the new empty rectangle box, then open the Fill N Stroke box and select the 'pattern' box, click on pattern fil, it's the one that kinda looks like diamonds, and voila, your empty box should now look just like your original photo. (There are ways to adjust the pattern if needed). Add a bunch of nodes so you have something to shape with, by highlighting all the nodes and clicking on the add nodes button several times. From that point one can manipulate the photo easily, add the curl to it, etc. You can create a duplicate rectangle under the new photo for the curl effect. Don't ya love that there are so many ways to create one simple effect.

dee


Return to “General Discussions”