A Random Selection of Inkscape Tricks
Inkscape is one of these vector graphics editors which were designed with enough flexibility in mind to let you do anything you need provided some creativity.
Inkscape may not be feature-packed like e.g. Adobe Illustrator. But it's sufficiently flexible to achieve anything you'll need. Here are some thoughts.
1 Filters and Extensions
A note for beginners, to answer a question I asked myself early on too when I started with Inkscape: what's the difference between filters and extensions?
Filters are just SVG bitmap filters. There are many presets and they can be changed with Filters → Filter Editor. Note that as soon as you apply a filter to an object, it will be bitmapped in a PDF output file even if the change isn't visible. This is why that when you want to make an object e.g. glow, you may want to duplicate it and only apply the filter to the copy below. What may seem a tad misleading, is that the Object → Fill and Stroke dialogue also lets you adjust blur to objects, which effectively acts upon a filter too. It's only special in the sense that's it's sufficiently commonly used that the Inkscape developers chose to provide a separate, more convenient control to work with it.
Extensions should be more seen as external scripts: contrary to filters, their effect cannot be adjusted/removed after they've been applied. They change the SVG the drawing is stored into. Extensions are typically Python scripts and are easy to write.
2 Non-Destructive Changes
I quite like that Inkscape provides path effects which let you change the aspect of paths in a parametrised sort of way, such that you can change the effects without loss and altogether discard them if you're really unhappy about them, getting back to your object in its pristine state.
The downside of path effects is that they're CPU intensive. I find it good practice to keep a copy of each set of objects throughout their successive changes. And since the easiest way to alleviate the CPU penalty incurred by using path effects is to turn them to paths, you may want to use copies there too.
A completely different approach involves using a version control system such as git to keep your changes non-destructive.
3 Glows and Shadows
There is a filter to drop shadows under Filters → Shadows and Glows → Drop Shadow... Unfortunately, it's rather inconvenient to use because once applied, adjusting parameters such as its offsets and blur requires understanding its inner workings.
A more convenient way to create glows and shadows is probably to just clone the object and Blur it with the Fill and Stroke dialogue. Blurring this way will cause it to create a filter on the fly and, more interestingly, set the dimensions of the filter properly – which is very important when exporting to PDF. It also seems to make alignments behave right when applied to objects and their glow/shadow. You can reliably and much more simply adjust the glow whenever you want with the Blur slider in the Fill and Stroke dialogue too.
The beauty of cloning instead of duplicating lies in the fact that changing the original object you want to cast a shadow from will automatically cause the shadow to be changed too, while retaining it's blur. However, you will lose the freedom to change the colour of the shadow.
4 Reliable Exports
For some older versions of Inkscape, the graphical export dialogues tended to hog the CPU if the drawing was complex. Thankfully, Inkscape provides non-interactive switches to e.g. export files to other formats. They are more reliable to use and relieve the system from displaying the complex scene.
inkscape --export-png ~/out.png --export-dpi=300 in.svg
inkscape --export-pdf ~/out.pdf --export-dpi=300 --export-text-to-path in.svg
You may choose to use the --export-text-to-path
option (-T
) to ensure that stroke is properly aligned to fill for some fonts which aren't well supported.
Some older versions of Inkscape didn't always do a good job of exporting PNGs, occasionally resulting in paths with missing segments. I haven't seen any problem with exporting PDFs and found it useful to export a PDF and then turn it into a bitmap.
5 Patterns along Paths
There's different things that you can draw along a path – e.g. text – and various ways to achieve it:
- The Pattern Along Path effect, available from Path → Path Effect Editor is parametrised but cannot offer the ribbon effect.
- Extensions → Generate from Path → Pattern along Path is an extension, and therefore not parametrised. But it provides the ribbon effect. That effect tends to misbehave in circumstances I still don't really understand: it looks as though it sometimes drew the path along the pattern instead of the other way around. It seems that duplicating the pattern and using the copy instead helps.
- Text → Put on Path probably does something similar for texts without having to turn them into paths beforehand. But no effect is available, then.
6 Increasing Thickness
A rather brutal way of adding thickness to e.g. text, but which looks good, is to duplicate it, add a stroke of the desired thickness to the copy and apply Path → Stroke to Path. The fill area will be discarded, leaving you only with the stroke path. You can then easily select it with the original object and perform a Path → Union.
7 Simulating Perspective
You can choose from the extension or path effect approach:
- Extensions → Modify Path → Envelope/Perspective. You'll have to provide a path to work from. This operation is not parametrised and destructive. But the resulting object is light and fast to work with afterwards.
- Path → Path Effect Editor → Envelope Deformation. This operation is parametrised and non-destructive. But the resulting object is heavy and slower to work with afterwards. You can change the shape of the size directly with handles.
8 Copying Gradients
Inkscape can be dangerous when it comes to copying gradients across documents: if you copy an object involving opacities of one same colour, the node opacities in the destination document will be used. For instance, if you copy an opaque-green to transparent-green shape to another document which has a not-so-transparent-green to opaque-green shape, the imported shape will also become not-so-transparent-green to opaque-green.
The solution is to give the imported shape a slightly different colour for at least one of the nodes. I once wrote the inkgrad tool which does just that. Note that the gradient orientation is preserved, however. And copying shapes with the same gradient name is not a problem either.