How to Crop a SVG

Post questions on how to use or achieve an effect in Inkscape.
kimF

How to Crop a SVG

Postby kimF » Sat Nov 22, 2008 11:41 pm

I am a new user and cannot figure out how to crop a svg file. Is there a detailed tutorial or can some give me detailed instruction on how to crop a portion of a rectangle off. Just a straight crop from top to bottom. Thanks!

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

Re: How to Crop a SVG

Postby brynn » Sun Nov 23, 2008 12:05 am

You can't crop in Inkscape, not in the usual sense. But you can get the job done using the Clip feature.

All you do is draw a rectangle around the part of your image that you want to keep. It sounds like you will want one side of the rectangle to extend all the way through your image from top to bottom. Just be sure that what you want to keep is inside the rectangle. Then select everything, and Object menu > Clip > Set. That should do it :D

Good luck!

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: How to Crop a SVG

Postby microUgly » Sun Nov 23, 2008 11:27 am

If you're looking to crop your entire drawing, this is what the canvas area does. Just set the location and size of the canvas and an SVG viewer won't display anything outside the canvas.

User avatar
EarlyBlake
Posts: 302
Joined: Tue Jun 03, 2008 5:42 pm

Re: How to Crop a SVG

Postby EarlyBlake » Sun Nov 23, 2008 2:11 pm

If you have a really big image the clipped image may eat a lot of CPU time and make working on the image in the future hard. If it's a really complicated image and you have too crop it. You can do a bunch intersections with a rectangle on paths that go out of bounds -- obviously time consuming. Or differences operations depending on how many sides a path goes out of bounds. If you just need a PNG file as output of your image, you can just export the parts you want by drawing a rectangle on it's own layer. It's important to put that rectangle, on a layer by it self. Then remove any fill or stroke from the rectangle. With the rectangle still selected do an export current selection. Next time you want to select the rectangle you will have to lock all the layers except the one the invisible rectangle, then do a select all from the edit menu, that is the only way to select an item without fill and stroke.


Return to “Help with using Inkscape”