Quick Inkscape Tutorial – Perspective Transforms

Let me start out by saying that far as open source software goes, Inkscape is definitely on my top 5 list and there a number of things that Inkscape can do that other proprietary vector graphics programs can't.   That said, I've used a few other proprietary vector graphics programs before and it seems like there are some nice features missing or buggy in Inkscape in its current state.  In many cases, you can get around the limitations of Inkscape and get the effects you want, you  just have to work a little harder than you would have in other software packages to get there.

I ran into one of these cases recently while trying to make a quick set of paths to use with my vinyl cutter to make a sticker for my laptop.  I used standard path operations to create a sensor tower warning symbol, but then I ran into trouble when I wanted to perform a perspective transformation.  Some other vector graphics packages roll this functionality into a "free-transformation" tool that allows you move each of the points of the bounding box of the currently selected objects and some separate this transform into its own tool/operation.

A quick Google search returned a number of videos showing how to perform a perspective transform, but it seems the functionality and path to it has changed over time.  After figuring everything out I also found this good post on all the pitfalls of perspective transformations here.   Basically, the old path for the perspective transformation was "Effects>Modify Path>Perspective" and it is now found under "Extensions>Modify Path>Perspective"  and it will only work if the paths you will be applying the transform to follow some strict guidelines.  Basically as of Inkscape 0.48.0 r9654 you'll need to make sure that:

  1. All elements you are going to transform must be paths.  No text objects, no bitmaps, no rectangles or other shapes, just paths.  If you've got any shapes amongst the paths you will be transforming you can convert them to paths by selecting them and got to "Path>Object to Path".
  2. All elements you are going to transform need to be grouped or in a combined path.  I was able to use nested groupings without issues but if your results are not as expected you may have to remove nested groups.
  3. You must define a "target shape" to determine the bounds of the transform that is a 4-sided polygon who's points are drawn clockwise starting from the bottom left corner.  Drawing the points in any other way will result in odd behavior.  All sides must be straight lines, no curves.
  4. You must select both the paths you will be transforming and the target shape by selecting your paths first then shift-clicking your target shape second.

After you've done all this, go to "Extensions>Modify Path>Perspective" and everything should work as expected.  In addition to being able to use nested groupings, I was able to assign transformations to individual paths and get predictable results, so some of the issues with the perspective extension may have been fixed recently.



5 Responses to “Quick Inkscape Tutorial – Perspective Transforms”

  1. Andrew P. says:

    The target polygon shape should not be drawn with any of the polygon tools. Use the Bezier pen tool, starting at the lower left and drawing in a clockwise fashion, making sure to close the path on the starting node.

    If the target shape is drawn with the rectangle polygon tool as an object, then converted to a path, the starting node location and path direction are unpredictable and may be difficult or impossible to fix using the mirroring and rotation tools available in Inkscape; it would be easier to edit the raw XML definition of the path. To avoid the hassle, just use the Bezier pen tool, tracing over a sample shape, if necessary.

  2. Denis G. says:

    You should also ensure that your paths are not in transformed groups. If so, the perspective tools will behave badly. You need to ungroup those transformed groups to get your path points transformed directly. You may group again after, and the group will not be transformed anymore.
    To know if your group are transformed, look at the XML editor for the transform attributes on them.

  3. Bill W says:

    The perspective tool was challenging to learn but when your target rectangle(s) are constructed according to good perspective principles, it makes some things possible that would take a long time otherwise. One thing I notice is that if you transform a circle, it will not be exactly right, which is to say that the quadrants don’t match up to the midpoints of the target “rectangle”. I have to offset them outward a little.

  4. Ian says:

    If the circles and other curves are distorted after transformation, it may help, before transformation, to add more nodes to those curves.

  5. Camilaran says:

    Nice ! Thank you very much.

Leave a Reply