Outils pour utilisateurs

Outils du site


issue211:inkscape

Ceci est une ancienne révision du document !


Last month saw the end of my articles describing the updates in Inkscape 1.3.x, so, after 150 months of bringing you all the gnarly details about every feature and corner of the application, I was looking forward to a few weeks off. No such luck. No sooner had I submitted the previous article about improvements to the Filters dialog, than version 1.4 was released. It doesn’t have as long a list of user-facing changes as some releases, though there has been a lot of work done under-the-hood to prepare for future development. Nevertheless, I plan to cover the new features in-depth, as usual – and perhaps this time I’ll get ahead of the developers enough to earn some time off!

As usual, the new release can be downloaded from the Inkscape website. It’ll probably take a little while to get into the repositories of most distros, but the website offers Linux users an AppImage version, and a PPA. I’ll be using the former simply because it’s easier for me, given that I have to keep a few older versions around as well for comparison purposes. If you’re using Ubuntu or another Debian-based system, and want only a single Inkscape version installed, the PPA might be your best option. Installers are also available for Windows and MacOS.

https://inkscape.org/release/inkscape-1.4/

In terms of describing the new features, I guess we may as well pick up where we left off: filters. Nothing has changed in terms of the filter editor dialog itself, though. The main Filter menu has been slightly rearranged to move the Filter Editor… entry towards the top of the layout, just below the new Filter Gallery… entry.

The Filter Gallery is one of the headlines of the 1.4 release, and is arguably long overdue. Back in the distant past, when this column first began, Inkscape didn’t come with any predefined filters. Whether you wanted a simple drop shadow or a more complex 3D lighting effect, you had no choice but to either create one from scratch using the filter editor, or to copy and paste an object which already had a suitable filter applied, from another document. This copy-pasting approach was so useful that a number of users on websites and forums made SVG files available that contained nothing but copies of the same object with different filters applied to each. In this way you could see the filter as it appeared on a real object in order to get a preview of how it looked, before copying the object into your own document and then applying the freshly imported filter chain to your own elements.

Version 0.47 introduced the hierarchical menu of predefined filters that we have now, and I’m sure most readers head there first when they need to add a filter to an object (I certainly do!). It’s much easier to pick a filter from a categorised list that’s built into the software than it is to: hunt for a third party filter file; open it; select the filtered object; copy it into your own document; apply the filter to your target element; finally, delete the copied object.

But as convenient as a curated list of named filters may be, one thing that was sorely lacking compared to the old approach was the ability to see what effect the filter has on real content before you apply it. That’s what the new Filter Gallery brings to Inkscape. Select that option, and you’ll be presented with this dialog (next page, top middle).

To the left is a list of the filter categories, corresponding mostly to the sub-menus in the Filters menu. One difference is the addition of an ‘All filters’ category at the top. As you’ve probably guessed, selecting an option in this list will filter the previews shown at the right to only include those from the corresponding category. The ‘All filters’ option does as its name suggests, and shows previews for all the available filters, regardless of category. Unfortunately the previews are still grouped by category in this mode, rather than appearing alphabetically by name, which doesn’t really make sense to me, especially as the groupings aren’t made clear with different background colours or badges on the previews.

The category list can be made wider or narrower by dragging the separator bar that sits between the list and the previews, though category names get truncated with an ellipsis in the middle rather than wrapping to multiple lines. The list panel can also be collapsed completely using the toggle button at the top-left of the dialog. There is a small bug, however, which makes this feature less useful than you might expect. Collapsing the list automatically switches to showing all the filter previews (as though you had the ‘All Filters’ category selected), which does make some sense. But if you click the toggle to expand the list again, it continues to show all previews, even if you have a specific category selected. Clicking the same, already selected, category does nothing. To kick it back into life you have to select a different category – after which you may re-select the original one, if you wish. It’s a small but annoying bug that reduces the utility of the collapse button significantly.

As well as selecting a category, the other way to reduce the number of previews that are shown is to use the filter field at the top-right. This filters dynamically as you type, also taking the selected category into account. Therefore entering some text in here can only ever reduce the number of visible previews, it won’t increase the number by displaying entries from other categories that match the search. This is a shame, as it would be more useful for it to show matches from within the category first, but also show other matches below a dividing line. That would allow you to use it to quickly select a specific filter without having to change categories.

At the right of the dialog is the preview pane, showing each individual filter chain as a preview image with the filter name below it. The size of the thumbnails can be adjusted using the slider hidden behind the ‘gear’ button at the top of the dialog. Moving this slider causes the previews to update dynamically, which can take a short while if there are a lot of them visible. That, in turn, leads to a jerky and frustrating UI. A better approach is to first select a category with few entries – perhaps ‘Image Effects’ or ‘Scatter’ – before adjusting the slider. This allows the UI to update far more smoothly, making it much easier to pick the preview size that best suits you.

Once you’ve found the filter you wish to use, click on its preview and then click the Apply button at the bottom of the dialog to apply it to your selected object(s). For some filters the button will actually say Apply… (i.e. with a trailing ellipsis). This indicates that a dialog will open allowing you to customise some parameters of the filter before actually applying it for real (using the Apply button in the second dialog). Unfortunately there’s no indication from the thumbnails which filters are customisable in this way. Of course they can all be customised using the Filter Editor dialog once they’ve been applied, but those with an ellipsis on the Apply button expose a curated subset of the most useful parameters, so I’d like to see them more obviously flagged.

If you do use a filter with a secondary dialog, there are a couple of things to note: the first is that this dialog will have a ‘Live preview’ checkbox towards the bottom. Enabling this box allows you to see what the final filter will look like on your objects before clicking the Apply button, making it easy to bail out by clicking the Close button instead. It’s a shame this feature isn’t present on all filters, whether they expose specific parameters or not. The second thing to note is that clicking Apply in the second dialog won’t close it, so you’ll have to manually do this if you want it removed from your screen while you continue your work.

Be aware that each time you click the Apply button for a given object the filter chain is appended to any existing chain. This can be useful if, for example, you want to use a visual effect from the Materials category, then add a drop shadow to the result. But it also means that if you just want to go through the list previewing how each filter looks on your object, you’ll need to remember to press Ctrl-Z between each one to avoid them stacking up. If you do want to apply multiple filters, I recommend grouping your object(s), multiple times if needed, to apply one filter per grouping level. By applying a separate filter to each group, rather than appending multiple filter chains to a single object, it makes it much easier to remove or modify a single filter at a time later.

One limitation of the Filter Gallery is that there’s only a single preview image available. While the flowery shape that has been chosen does a good job of representing most filters, the thick lobes may not be representative of the object you wish to apply the filter to in your specific image. Text, for example, can vary wildly between thick slab-serif fonts and wispy cursive styles – and the effect of a given filter can be markedly different between the two. It would be great for a future version of this dialog to offer a few different preview shapes, perhaps including an option to preview against some user-defined text in a font of your choice.

Although the selection of predefined filters supplied with Inkscape is quite comprehensive, there may be times when you need something different. Perhaps you have a house-style for a particular filter that you need to apply again and again across different documents – that’s certainly the case with the drop shadows I use on the speech bubbles in some of my comic strips, for example. While you can certainly just copy and paste a filtered object between files as a way to copy the filter chain itself, an alternative is to create a custom filter that is registered with Inkscape. Don’t worry, it’s easier than it sounds.

The first step is simply to create a filter chain that suits your needs. One way to do this is just to start with one of the predefined filters by applying it to an object in a file then tweaking the parameters via the Filter Editor dialog. Alternatively you can create an entire filter chain from scratch, as I described last month.

In fact, let’s use last month’s filter as an example: it’s a simple drop shadow which uses the object’s alpha to define the shadow, resulting in a dark shadow that can only ever be black (this is why Inkscape’s own Drop Shadow filter, with its various parameters and colour picker, is usually a better option). The filter chain we created last time looks like the image shown below.

Most importantly I’ve opened the ‘Filter’ popup at the top of the dialog and used it to rename the filter from the default ‘filter1’ to the more descriptive ‘Dark drop shadow’. This isn’t essential, but giving your filters sensible names will make them a lot easier to identify when you come to use them. Save the file somewhere you can easily find later.

The next step is to open Inkscape’s ‘User config’ directory in your file manager. You may not know where this is kept, but you can find the path listed in the Inkscape Preferences dialog (Edit > Preferences) in the ‘System’ pane (shown below).

Rather usefully, Inkscape provides a button to open this directory via your file manager. Within that directory you should create a ‘filters’ folder, if there’s not one there already. Navigate into that directory, then copy the SVG file you saved earlier into it. Quit and restart Inkscape for it to pick up the new addition.

If all has gone according to plan you’ll now have a new ‘Personal’ entry in the Filters menu – and a corresponding new category in the Filter Gallery.

You can now easily select your filter and apply it to objects across all your Inkscape projects.

This feature can be extremely useful – but there’s also a bug that makes it rather annoying. If you’re the sort of person who uses this capability, it’s likely that you’ll also want to create multiple custom filters. That’s fine, just add them all to one file in that config directory and they’ll appear in the UI. Or add multiple files, with one filter in each, and they’ll equally appear in the UI. But if you add multiple files, each of which contains multiple filters, only the first one in each file will appear in the UI. This is a rather frustrating limitation which makes it harder to collect and share files filled with filters between different users. Remember: one file with multiple filters, or multiple files each with one filter. But not multiple files with multiple filters.

In a similar vein, there’s one final annoyance in the Filter Gallery I’d like to bring up: why doesn’t it have a category for the filters that are being used in the current document? I often need to use the same filters multiple times in a single document, and it would be useful to be able to preview and select them from the gallery UI in the same way as custom filters I’ve saved into the config directory.

But those small issues aside, this dialog is a great addition to Inkscape, and one that’s long overdue. Hopefully we’ll get the option for different preview images in future, and some of the small UI bugs and issues will be ironed out, but even as it stands it’s still very useful for those of us who like to add a little bitmap magic to those otherwise too-clean vector images.

issue211/inkscape.1732989890.txt.gz · Dernière modification : 2024/11/30 19:04 de auntiee