issue208:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue208:inkscape [2024/08/31 14:29] – créée auntiee | issue208:inkscape [2024/09/02 09:27] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | I’ve looked at using clipping paths in Inkscape on several occasions in this series. This time, I’m going to hark all the way back to part 32, which appeared in FCM #92 in December 2014! In that article, I looked at some clipping techniques that could be applied to any type of object, but which were particularly suited to bitmap images. I used this familiar lady as my subject. | + | **I’ve looked at using clipping paths in Inkscape on several occasions in this series. This time, I’m going to hark all the way back to part 32, which appeared in FCM #92 in December 2014! In that article, I looked at some clipping techniques that could be applied to any type of object, but which were particularly suited to bitmap images. I used this familiar lady as my subject. |
- | The highest resolution version of this file weighs in at nearly 90MB, so it’s not the sort of thing you’d want to embed into an SVG file – especially not multiple times. One solution to this is to link the image into your Inkscape document rather than embed it, but there are occasions when embedding is the better option. The classic example of this is when you want to share the file with somebody else. Inkscape will also sometimes use absolute rather than relative paths when embedding images, which makes them less practical to move between systems. You can manually edit the paths to make them relative, which helps the situation a lot, but you’re still left with an Inkscape document that actually consists of two or more files that have to be moved as one. Embedding images solves all these problems, but this comes at the cost of a larger file, since it now contains a copy of the bitmap data in a text-based encoding that bloats it even further. | + | The highest resolution version of this file weighs in at nearly 90MB, so it’s not the sort of thing you’d want to embed into an SVG file – especially not multiple times. One solution to this is to link the image into your Inkscape document rather than embed it, but there are occasions when embedding is the better option. The classic example of this is when you want to share the file with somebody else. Inkscape will also sometimes use absolute rather than relative paths when embedding images, which makes them less practical to move between systems. You can manually edit the paths to make them relative, which helps the situation a lot, but you’re still left with an Inkscape document that actually consists of two or more files that have to be moved as one. Embedding images solves all these problems, but this comes at the cost of a larger file, since it now contains a copy of the bitmap data in a text-based encoding that bloats it even further.** |
- | The main subject of part 32 was therefore how to avoid embedding multiple copies of an image in your document when you need to reference different parts of it. The example provided was of an information leaflet that contains clipped images of La Giaconda’s head and hands. | + | J'ai examiné l' |
+ | |||
+ | La version dans la plus haute résolution de ce fichier pèse près de 90 Mo, ce n'est donc pas le genre d' | ||
+ | |||
+ | |||
+ | **The main subject of part 32 was therefore how to avoid embedding multiple copies of an image in your document when you need to reference different parts of it. The example provided was of an information leaflet that contains clipped images of La Giaconda’s head and hands. | ||
Despite appearances, | Despite appearances, | ||
- | That alone isn’t enough to get this effect, but it’s a prerequisite that makes for a good tip in general. With the clipping path applied to the group rather than the image itself, you can still double-click to enter the group, then move the image within it to change the point of focus. What you can also do is clone the image within the group, then cut it to the clipboard, exit the group, and paste it somewhere else (even on another layer). Because you’ve cloned the image itself, not the clipped group, you get a complete copy of the image that can be further manipulated. In this case, the requirement was to clip the clone to show only the hands, and position it beside the head. | + | That alone isn’t enough to get this effect, but it’s a prerequisite that makes for a good tip in general. With the clipping path applied to the group rather than the image itself, you can still double-click to enter the group, then move the image within it to change the point of focus. What you can also do is clone the image within the group, then cut it to the clipboard, exit the group, and paste it somewhere else (even on another layer). Because you’ve cloned the image itself, not the clipped group, you get a complete copy of the image that can be further manipulated. In this case, the requirement was to clip the clone to show only the hands, and position it beside the head.** |
- | While we’re on the subject of clipping tips, another useful tip is to always convert your clipping shape into an actual path if it’s not already one. That means any rectangles, ellipses, stars, or regular polygons, that you want to use as a clipping path, should generally be converted using the Path > Object to Path menu entry before you apply the clip. The reason? It means that the path can be edited using the Node tool (F2) without unclipping first, which is not only a time-saver but also gives you a more representative view of how the final clipped object will look while you’re editing the path. Note that this capability can be toggled on and off when the Node tool is selected, by using this button in the toolbar; so make sure it’s enabled if necessary. | + | Le sujet principal de la partie 32 était donc d' |
- | This is all well and good, but this month’s column isn’t really about repeating some tips from a decade ago, no matter how useful they still are. Instead, I want to talk about a new feature in Inkscape 1.3 which might make the previous approach redundant… at least in some cases. | + | Malgré les apparences, le document de cette capture d' |
- | Looking back at the original requirement, | + | Ce n'est pas suffisant pour obtenir cet effet, mais c'est une condition préalable qui permet d' |
+ | |||
+ | |||
+ | **While we’re on the subject of clipping tips, another useful tip is to always convert your clipping shape into an actual path if it’s not already one. That means any rectangles, ellipses, stars, or regular polygons, that you want to use as a clipping path, should generally be converted using the Path > Object to Path menu entry before you apply the clip. The reason? It means that the path can be edited using the Node tool (F2) without unclipping first, which is not only a time-saver but also gives you a more representative view of how the final clipped object will look while you’re editing the path. Note that this capability can be toggled on and off when the Node tool is selected, by using this button in the toolbar; so make sure it’s enabled if necessary. | ||
+ | |||
+ | This is all well and good, but this month’s column isn’t really about repeating some tips from a decade ago, no matter how useful they still are. Instead, I want to talk about a new feature in Inkscape 1.3 which might make the previous approach redundant… at least in some cases.** | ||
+ | |||
+ | Puisque nous parlons d' | ||
+ | |||
+ | Tout cela est bien beau, mais la rubrique de ce mois-ci n'a pas pour but de répéter des conseils datant d'une dizaine d' | ||
+ | |||
+ | |||
+ | **Looking back at the original requirement, | ||
Obviously there’s at least one copy of the entire image embedded into the Inkscape document, even though the vast majority of the pixels don’t appear in the final output. All those invisible pixels still contribute to the file size. | Obviously there’s at least one copy of the entire image embedded into the Inkscape document, even though the vast majority of the pixels don’t appear in the final output. All those invisible pixels still contribute to the file size. | ||
- | The most obvious way to avoid this is to edit the original image using a bitmap editor such as The GIMP or Krita, but that assumes you know how to use such programs to slice your image into individual parts, and save them as separate files. Wouldn’t it be nicer if Inkscape could take care of this for you, using the tools you already know? Well now it can. | + | The most obvious way to avoid this is to edit the original image using a bitmap editor such as The GIMP or Krita, but that assumes you know how to use such programs to slice your image into individual parts, and save them as separate files. Wouldn’t it be nicer if Inkscape could take care of this for you, using the tools you already know? Well now it can.** |
- | To demonstrate I’m going to drag and drop my image into the Inkscape window. By default, you will be prompted as to whether you wish to link or embed the file, and I’ll choose to link it. | + | Si l'on se réfère à la demande initiale, l' |
+ | |||
+ | Il est évident qu'il y a au moins une copie de l' | ||
+ | |||
+ | La façon la plus évidente d' | ||
+ | |||
+ | |||
+ | **To demonstrate I’m going to drag and drop my image into the Inkscape window. By default, you will be prompted as to whether you wish to link or embed the file, and I’ll choose to link it. | ||
If you don’t see that dialog then you likely clicked the “Don’t ask again” checkbox on a previous occasion. It doesn’t really matter too much whether the image is linked or embedded at this point (it will end up embedded by the end anyway), but I prefer to link it to avoid bloating the SVG file when I save incremental work-in-progress copies of the file. If you do want to reinstate this dialog, then open the Inkscape preferences (Edit > Preferences), | If you don’t see that dialog then you likely clicked the “Don’t ask again” checkbox on a previous occasion. It doesn’t really matter too much whether the image is linked or embedded at this point (it will end up embedded by the end anyway), but I prefer to link it to avoid bloating the SVG file when I save incremental work-in-progress copies of the file. If you do want to reinstate this dialog, then open the Inkscape preferences (Edit > Preferences), | ||
- | In this particular case, I want to use two sections of this image, but this technique is just as applicable to a single clipping path on a single image, should you want to remove the extraneous pixels that take up space in your SVG file. But, for two sections, I need two copies of the image: not clones this time, but real copies. Selecting my imported image and duplicating it (Ctrl-D) does the job. If you embedded the image, then saving at this point will result in a very large file, with the content of your image stored twice in the SVG file. If you linked the file there will be no such concerns, and your SVG file remains almost as svelte as ever. | + | In this particular case, I want to use two sections of this image, but this technique is just as applicable to a single clipping path on a single image, should you want to remove the extraneous pixels that take up space in your SVG file. But, for two sections, I need two copies of the image: not clones this time, but real copies. Selecting my imported image and duplicating it (Ctrl-D) does the job. If you embedded the image, then saving at this point will result in a very large file, with the content of your image stored twice in the SVG file. If you linked the file there will be no such concerns, and your SVG file remains almost as svelte as ever.** |
- | Now I’ll create the clipping paths that mark out the sections of the images that I want to keep. The tip about converting any primitive objects to paths still applies. Here’s how my document looks so far with my clipping paths given a bright green stroke as is my usual preference. | + | Pour la démonstration, |
+ | |||
+ | Si vous ne voyez pas cette boîte de dialogue, c'est que vous avez probablement coché la case « Ne plus demander » à une autre occasion. Le fait que l' | ||
+ | |||
+ | Dans ce cas particulier, | ||
+ | |||
+ | |||
+ | **Now I’ll create the clipping paths that mark out the sections of the images that I want to keep. The tip about converting any primitive objects to paths still applies. Here’s how my document looks so far with my clipping paths given a bright green stroke as is my usual preference. | ||
The next step is to select one image and its associated clipping path, and apply the clip. I usually right-click and select ‘Set Clip’ from the context menu, but Object > Clip > Set Clip does the same thing if right-clicking isn’t practical for you. Repeat for the other image and path. | The next step is to select one image and its associated clipping path, and apply the clip. I usually right-click and select ‘Set Clip’ from the context menu, but Object > Clip > Set Clip does the same thing if right-clicking isn’t practical for you. Repeat for the other image and path. | ||
Ligne 31: | Ligne 62: | ||
This is the time to get the shape, position and size of your clipping paths absolutely perfect. We didn’t group the image first, so the trick of double-clicking to move the focus won’t work here. But we can switch to the Node tool and move the entire clipping path if necessary – just select all the nodes (Ctrl-A will do the job) and you can drag the entire thing around. Of course you can also edit individual nodes to change the shape of the path. If you need to change its size, but not its shape, select all the nodes and use the ‘<’ and ‘>’ keys. ‘[‘ and ‘]’ will similarly rotate the path. | This is the time to get the shape, position and size of your clipping paths absolutely perfect. We didn’t group the image first, so the trick of double-clicking to move the focus won’t work here. But we can switch to the Node tool and move the entire clipping path if necessary – just select all the nodes (Ctrl-A will do the job) and you can drag the entire thing around. Of course you can also edit individual nodes to change the shape of the path. If you need to change its size, but not its shape, select all the nodes and use the ‘<’ and ‘>’ keys. ‘[‘ and ‘]’ will similarly rotate the path. | ||
- | Right, are you happy with the clipping? Make sure you are, because once you take the next step, Inkscape will throw away much of the original image, so there’s no turning back. (Okay, Ctrl-Z works to undo as usual, but what I mean is that this is a destructive change that can’t be undone once you’ve closed and reopened the file later). | + | Right, are you happy with the clipping? Make sure you are, because once you take the next step, Inkscape will throw away much of the original image, so there’s no turning back. (Okay, Ctrl-Z works to undo as usual, but what I mean is that this is a destructive change that can’t be undone once you’ve closed and reopened the file later).** |
- | Right-click on one of the clipped | + | Je vais maintenant créer les chemins de détourage qui délimitent les parties des images |
- | Now it would be a big problem if Inkscape clipped a linked | + | L' |
- | Our final cropped and clipped images can now be positioned and manipulated as normal, with the advantage that the bounding boxes look a lot more sensible. | + | C'est le moment de parfaire la forme, la position et la taille de vos chemins de détourage. Nous n' |
+ | |||
+ | Vous êtes satisfait de la découpe ? Assurez-vous que c'est le cas, car lorsque vous passerez à l' | ||
+ | |||
+ | |||
+ | **Right-click on one of the clipped images and you should find a new entry in the context menu: “Crop Image to Clip”. Select that, and Inkscape will throw away the hidden pixels… sort of. The reason for that caveat is that there aren’t any widely used bitmap formats that support non-rectangular images, so in the case of a non-rectangular clipping path, you’ll still find that some hidden pixels remain (you can remove the clip to see them). But for all practical purposes, your image has been reduced to just the clipped area, even if a few extraneous pixels are technically still present in the corners. | ||
+ | |||
+ | Now it would be a big problem if Inkscape clipped a linked image in this way. You wouldn’t want Inkscape to destructively modify your original image. What happens if that same image is linked into another document, perhaps in a completely different application? | ||
+ | |||
+ | Cliquez avec le bouton droit de la souris sur l'une des images découpées et vous devriez trouver une nouvelle entrée dans le menu contextuel : « Découper l' | ||
+ | |||
+ | Ce serait un gros problème si Inkscape coupait une image liée de cette manière. Vous ne voudriez pas qu' | ||
+ | |||
+ | |||
+ | **Our final cropped and clipped images can now be positioned and manipulated as normal, with the advantage that the bounding boxes look a lot more sensible. | ||
This new feature will be useful in a lot of cases where users want to use Inkscape to clip or crop bitmap images, but it’s not a panacea, and needs to be used with consideration for its merits and its drawbacks. Where your clipping path encompasses most of the image – just removing a small amount from around the edges – it’s probably not worth using this technique. The savings in file size will be minimal, and the destructive nature of the editing means you’ll lose some ability to tweak and refine your clipping path or image position later on. | This new feature will be useful in a lot of cases where users want to use Inkscape to clip or crop bitmap images, but it’s not a panacea, and needs to be used with consideration for its merits and its drawbacks. Where your clipping path encompasses most of the image – just removing a small amount from around the edges – it’s probably not worth using this technique. The savings in file size will be minimal, and the destructive nature of the editing means you’ll lose some ability to tweak and refine your clipping path or image position later on. | ||
Ligne 43: | Ligne 88: | ||
The example I used here does make sense… but if we’d wanted larger areas, or boxes that overlap the same part of the original image, the file size might not actually get much smaller. Each embedded cropped image carries some overhead, so it’s even possible that taking multiple views in this way could result in a larger SVG file than if the entire original image was just embedded once. | The example I used here does make sense… but if we’d wanted larger areas, or boxes that overlap the same part of the original image, the file size might not actually get much smaller. Each embedded cropped image carries some overhead, so it’s even possible that taking multiple views in this way could result in a larger SVG file than if the entire original image was just embedded once. | ||
- | The feature itself is not very discoverable. You have to have already applied a clip to an image directly (not an image in a group), and only then does it appear in the context menu. Why can’t we have a “Crop and clip” context menu entry that does both steps as one? | + | The feature itself is not very discoverable. You have to have already applied a clip to an image directly (not an image in a group), and only then does it appear in the context menu. Why can’t we have a “Crop and clip” context menu entry that does both steps as one?** |
- | It’s also worth noting that this applies to only bitmap | + | Nos images |
- | Overall I think this is a very useful addition to Inkscape’s arsenal. It’s just a shame that the lack of discoverability means that the people who will most benefit from it – the new users who also aren’t comfortable with bitmap | + | Cette nouvelle fonctionnalité sera utile dans de nombreux cas où les utilisateurs souhaitent utiliser |
+ | L' | ||
+ | La fonction elle-même n'est pas très facile à découvrir. Il faut avoir déjà appliqué un détourage à une image directement (pas à une image dans un groupe), et ce n'est qu' | ||
+ | |||
+ | |||
+ | **It’s also worth noting that this applies to only bitmap images. For simple vector shapes, the equivalent method is to use the Boolean operations, but for complex groups of objects, there is no easy equivalent that will cut away the parts of objects that are not visible due to clipping. While the file size argument is less pressing with vector objects, there are times when it would be nice to be able to ‘tidy up’ an image in a similar way. I suspect there are too many edge cases for that to be an easy thing for the developers to achieve, though. | ||
+ | |||
+ | Overall I think this is a very useful addition to Inkscape’s arsenal. It’s just a shame that the lack of discoverability means that the people who will most benefit from it – the new users who also aren’t comfortable with bitmap editors – are those most likely to miss it. If you know someone like that, point them in the direction of this article. | ||
Image Credits | Image Credits | ||
“La Gioconda” (aka “Mona Lisa”) by Leonardo da Vinci | “La Gioconda” (aka “Mona Lisa”) by Leonardo da Vinci | ||
+ | http:// | ||
+ | |||
+ | Il convient également de noter que cela ne s' | ||
+ | |||
+ | Dans l' | ||
+ | |||
+ | Crédits d' | ||
+ | |||
+ | « La Gioconda » (alias “Mona Lisa”) de Léonard de Vinci | ||
http:// | http:// | ||
issue208/inkscape.1725107365.txt.gz · Dernière modification : 2024/08/31 14:29 de auntiee