issue171:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue171:inkscape [2021/08/01 19:20] – créée auntiee | issue171:inkscape [2021/08/06 09:54] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | This month, I’ll be concluding my look at the Trace Bitmap dialog by examining the new tracing modes that have been introduced with Inkscape v1.0, including one that has been much requested on the forum over the years. | + | **This month, I’ll be concluding my look at the Trace Bitmap dialog by examining the new tracing modes that have been introduced with Inkscape v1.0, including one that has been much requested on the forum over the years. |
Autotrace | Autotrace | ||
- | Inkscape has long offered tracing of bitmaps using the Potrace library. While this does a fine job of vectorising raster graphics, it’s not the only open source tool that performs this trick. Autotrace is a command-line tool of similar vintage, which has now been integrated into the Trace Bitmap dialog. It’s available in the mode selection pop-up, in both single-scan and multiple-scan varieties. The latter is labelled as “Autotrace (slower)”, | + | Inkscape has long offered tracing of bitmaps using the Potrace library. While this does a fine job of vectorising raster graphics, it’s not the only open source tool that performs this trick. Autotrace is a command-line tool of similar vintage, which has now been integrated into the Trace Bitmap dialog. It’s available in the mode selection pop-up, in both single-scan and multiple-scan varieties. The latter is labelled as “Autotrace (slower)”, |
- | Once selected, it offers two spinboxes and an “Invert image” checkbox. The latter, as the name suggests, inverts the image colors before tracing, making it easier to trace a light-on-dark design without having to manually process it first. The effect of the two spinboxes is somewhat harder to guess at. | + | Ce mois-ci, je conclurai mon étude de la boîte de dialogue Vectoriser un objet matriciel en examinant les nouveaux modes de traçage qui ont été introduits avec Inkscape v1.0, dont un qui a été très demandé sur le forum au fil des ans. |
- | The scant documentation for Autotrace – basically an online copy of the man page for the command-line tool – describes the “Filter iterations” option thus: Smooth the curve the specified number of times prior to fitting. Without knowing what is meant by “fitting” in this algorithm, it’s hard to infer what this actually does. Trial-and-error suggests that it reduces the fidelity of the trace somewhat, smoothing out the generated vectors and tending to result in a trace with fewer nodes. Here’s what the most extreme values look like when applied to dear old Frankie. The original bitmap is on the left, with clipped versions of the traced head to the right. For the top trace, the filter iterations was set to 1; for the bottom it was set to 20. | + | Autotrace |
+ | |||
+ | Inkscape propose depuis longtemps le traçage des bitmaps à l'aide de la bibliothèque Potrace. Bien que cette dernière fasse un excellent travail de vectorisation des dessins matriciels, ce n'est pas le seul outil Open Source qui réalise cette opération. Autotrace est un outil en ligne de commande de la même cuvée, qui a été intégré dans la boîte de dialogue Vectoriser un objet matriciel. Il est disponible dans la fenêtre pop-up de sélection du mode, à la fois en version simple et multiple. Cette dernière est étiquetée « Autotrace (plus lent) », ce qui suggère qu' | ||
+ | |||
+ | **Once selected, it offers two spinboxes and an “Invert image” checkbox. The latter, as the name suggests, inverts the image colors before tracing, making it easier to trace a light-on-dark design without having to manually process it first. The effect of the two spinboxes is somewhat harder to guess at. | ||
+ | |||
+ | The scant documentation for Autotrace – basically an online copy of the man page for the command-line tool – describes the “Filter iterations” option thus: Smooth the curve the specified number of times prior to fitting. Without knowing what is meant by “fitting” in this algorithm, it’s hard to infer what this actually does. Trial-and-error suggests that it reduces the fidelity of the trace somewhat, smoothing out the generated vectors and tending to result in a trace with fewer nodes. Here’s what the most extreme values look like when applied to dear old Frankie. The original bitmap is on the left, with clipped versions of the traced head to the right. For the top trace, the filter iterations was set to 1; for the bottom it was set to 20.** | ||
+ | |||
+ | Une fois sélectionné, | ||
+ | |||
+ | La maigre documentation d' | ||
+ | |||
+ | **Note that the higher iterations have reduced or wiped out the whites of the eyes, while the veins on the brain are a mere shadow of the original. The shape of the ear and of the brain’s outline are also significantly smoother. The total node count for the traced head is 485 for the top image and 410 for the bottom one. | ||
- | Note that the higher iterations have reduced or wiped out the whites of the eyes, while the veins on the brain are a mere shadow | + | The second spinbox, for setting |
- | The second spinbox, for setting the “Error threshold”, | + | Notez que les itérations plus nombreuses ont réduit ou supprimé le blanc des yeux, tandis que les veines du cerveau ne sont qu'une ombre de l'original. |
+ | La deuxième boîte à compteur, pour le réglage du « Seuil d' | ||
- | It’s pretty clear that the higher value results in a trace that is so smoothed out as to lose many of the original shapes completely. The top image, where the paths were much more heavily subdivided, consists of 587 nodes; the bottom one has only 327. | + | **It’s pretty clear that the higher value results in a trace that is so smoothed out as to lose many of the original shapes completely. The top image, where the paths were much more heavily subdivided, consists of 587 nodes; the bottom one has only 327. |
As is often my advice in this column, I suggest most users should at least start with the default values for both spinboxes, and start tweaking them only if you need to improve the fidelity of the trace, or want to take the counter-approach of reducing the number of nodes. Even in the latter case, I would probably be more inclined to trace with the defaults and then use Path > Simplify afterwards. | As is often my advice in this column, I suggest most users should at least start with the default values for both spinboxes, and start tweaking them only if you need to improve the fidelity of the trace, or want to take the counter-approach of reducing the number of nodes. Even in the latter case, I would probably be more inclined to trace with the defaults and then use Path > Simplify afterwards. | ||
Perhaps the biggest question is how the Autotrace results compare with the Potrace equivalents. Here’s another pair of traced Frankies created using the default settings: The Potrace-based “Brightness cutoff” at the top; the Autotrace version at the bottom. Again, the full head on the left is the original raster image. | Perhaps the biggest question is how the Autotrace results compare with the Potrace equivalents. Here’s another pair of traced Frankies created using the default settings: The Potrace-based “Brightness cutoff” at the top; the Autotrace version at the bottom. Again, the full head on the left is the original raster image. | ||
- | The first thing to note is that the Autotrace version has maintained the grey color of the original image – though that’s such a trivial thing to change that it shouldn’t be used as a reason to select one over the other. The Potrace result is a lot crisper, with the paths more accurately maintaining the sharp corners of the head, and thinner lines of the eyebrows. This accuracy is reflected in the node count: 1090 for Potrace but only 440 for Autotrace. | + | The first thing to note is that the Autotrace version has maintained the grey color of the original image – though that’s such a trivial thing to change that it shouldn’t be used as a reason to select one over the other. The Potrace result is a lot crisper, with the paths more accurately maintaining the sharp corners of the head, and thinner lines of the eyebrows. This accuracy is reflected in the node count: 1090 for Potrace but only 440 for Autotrace.** |
- | But it’s not that clearcut. The extremely thin lines on the brain are actually better preserved by the Autotrace algorithm. On the whole, I think the old Potrace code works best, at least in this case. But I also wouldn’t rule out creating a hybrid result by using node editing or Boolean operations to paste together the best parts from each result. | + | Il est assez clair que la valeur la plus élevée donne un tracé tellement lissé qu'il perd complètement la plupart des formes originales. L' |
+ | |||
+ | Comme je le conseille souvent dans cette rubrique, je suggère à la plupart des utilisateurs de commencer avec les valeurs par défaut pour les deux boîtes à compteur, et de ne commencer à les modifier que si vous avez besoin d' | ||
+ | |||
+ | La question la plus importante est peut-être de savoir comment les résultats d' | ||
+ | |||
+ | La première chose à noter est que la version d' | ||
+ | |||
+ | **But it’s not that clearcut. The extremely thin lines on the brain are actually better preserved by the Autotrace algorithm. On the whole, I think the old Potrace code works best, at least in this case. But I also wouldn’t rule out creating a hybrid result by using node editing or Boolean operations to paste together the best parts from each result. | ||
Autotrace (multiple scans) | Autotrace (multiple scans) | ||
- | What about using the “Autotrace (slower)” mode for scanning color images? My advice is to avoid it completely and stick to the Potrace-based modes. I tried scanning the same images that I used for part 19 of this series: the Full Circle Magazine logo, and a Wikimedia Commons copy of “La Giaconda” (The Mona Lisa). In both cases I used the default settings. The logo, which takes less than a second to trace with Potrace, took several minutes to complete. With such an amount of effort involved you might expect something impressive, but this is what the result looks like (original bitmap on the left, Autotrace in the middle, Potrace on the right): | + | What about using the “Autotrace (slower)” mode for scanning color images? My advice is to avoid it completely and stick to the Potrace-based modes. I tried scanning the same images that I used for part 19 of this series: the Full Circle Magazine logo, and a Wikimedia Commons copy of “La Giaconda” (The Mona Lisa). In both cases I used the default settings. The logo, which takes less than a second to trace with Potrace, took several minutes to complete. With such an amount of effort involved you might expect something impressive, but this is what the result looks like (original bitmap on the left, Autotrace in the middle, Potrace on the right):** |
+ | |||
+ | Mais ce n'est pas aussi clair. Les lignes extrêmement fines sur le cerveau sont en fait mieux préservées par l' | ||
+ | |||
+ | Autotrace (passes multiples) | ||
+ | |||
+ | Qu'en est-il de l' | ||
- | To you and I it may appear as though Autotrace spent several minutes producing a salmon-colored circle. But no: what you’re actually looking at is a group of 4180 objects! For comparison the Potrace version contains 8 objects – one for each color set via the “Scans” spinbox. | + | **To you and I it may appear as though Autotrace spent several minutes producing a salmon-colored circle. But no: what you’re actually looking at is a group of 4180 objects! For comparison the Potrace version contains 8 objects – one for each color set via the “Scans” spinbox. |
Switching to the outline view does suggest that the shapes have been traced, and are hidden somewhere in the salmon fillet before us, but the thicker outlines definitely hint at complex paths compared with the simplicity of the Potrace version. | Switching to the outline view does suggest that the shapes have been traced, and are hidden somewhere in the salmon fillet before us, but the thicker outlines definitely hint at complex paths compared with the simplicity of the Potrace version. | ||
- | And what of La Giaconda? After many minutes of processing my memory, swap and CPU were all maxed out, then Inkscape disappeared off my screen entirely. There was no appearance of the usual crash dialog I see when it dies, leading me to suspect that its demise was perhaps the fault of the Linux kernel killing it due to lack of available resources. | + | And what of La Giaconda? After many minutes of processing my memory, swap and CPU were all maxed out, then Inkscape disappeared off my screen entirely. There was no appearance of the usual crash dialog I see when it dies, leading me to suspect that its demise was perhaps the fault of the Linux kernel killing it due to lack of available resources.** |
- | Even with a “successful” trace, the sheer number of objects created is practically unmanageable. There may, perhaps, be some image types for which this mode offers an advantage, but I would try it only if the Potrace methods aren’t yielding acceptable results – and make sure to save your file first! | + | À nous deux, il peut sembler qu' |
+ | |||
+ | Le fait de passer à la vue des contours suggère que les formes ont été tracées et qu' | ||
+ | |||
+ | Et qu'en est-il de La Joconde ? Après plusieurs minutes de traitement, ma mémoire, mon espace d' | ||
+ | |||
+ | **Even with a “successful” trace, the sheer number of objects created is practically unmanageable. There may, perhaps, be some image types for which this mode offers an advantage, but I would try it only if the Potrace methods aren’t yielding acceptable results – and make sure to save your file first! | ||
Center Line Trace | Center Line Trace | ||
- | If Autotrace offers little or no improvement over Potrace, and in some cases is far too resource hungry, why bother adding it to Inkscape at all? The reason is that it offers one type of frequently requested tracing mode that Potrace does not – center line tracing. In fact the menu entries described previously are there only as a side-effect of including this mode. After all, if you’re adding the library anyway, why not also expose the standard tracing mode as well, to give your users more options. | + | If Autotrace offers little or no improvement over Potrace, and in some cases is far too resource hungry, why bother adding it to Inkscape at all? The reason is that it offers one type of frequently requested tracing mode that Potrace does not – center line tracing. In fact the menu entries described previously are there only as a side-effect of including this mode. After all, if you’re adding the library anyway, why not also expose the standard tracing mode as well, to give your users more options.** |
- | Center line tracing is really applicable to only line art in which the shapes are made up of individual pen or pencil strokes. Using other tracing modes, each stroke is converted into a closed, filled path that reflects the thickness and shape of the original artwork. With this new mode, however, the tracing algorithm attempts to determine a single path that traces out a line following the middle of the original stroke. | + | Même avec un tracé « réussi », le nombre d' |
- | For the most simple real-world example, consider a single pen stroke on paper, scanned and imported into Inkscape. The top line in this image is the original scanned raster graphic. The second shows the result of a normal trace – note that the bulbous ends of the line are reproduced in this mode. The third line is the result of a center line trace – no thickening of the line at the ends of this version. | + | Traçage par Ligne centrale |
- | The real difference becomes clear when we take a closer look at the nodes used to make up the two traced paths. The first is a closed, filled path, so you can see that the nodes make up the outer shape of the stroke. The center line trace, on the other hand, results in an open path made up of a simple line of nodes: any suggestion of line thickness is purely down to the value set for the stroke width. | + | Si Autotrace n' |
- | What happens when you try this mode with a more complex example? How about a few handwritten letters? | + | **Center line tracing is really applicable to only line art in which the shapes are made up of individual pen or pencil strokes. Using other tracing modes, each stroke is converted into a closed, filled path that reflects the thickness and shape of the original artwork. With this new mode, however, the tracing algorithm attempts to determine |
- | As you can see, the trace doesn’t really reflect the shapes | + | For the most simple real-world example, consider a single pen stroke on paper, scanned |
- | You may also have realised that such shapes can’t be made up of a single path segment. In this instance | + | The real difference becomes clear when we take a closer look at the nodes used to make up the two traced paths. The first is a closed, filled |
- | The A, not unreasonably, | + | Le traçage de la ligne centrale ne s' |
- | You may think I’m being unfair on the algorithm here. My scanned text was from a thick Sharpie, rather than the thin strokes of a pencil or ballpoint pen. But based on my testing, you’ll likely face similar issues, even when starting with thinner lines in the source material. | + | Pour l' |
- | That’s not to say that the new mode is useless or unwelcome. For many images it will prove to be far more effective than the existing tracing methods, especially if you’re interested in only the core shapes of the elements rather than the exact details of the stroke outlines. Just remember that it’s working only with pixels, and has no concept of the order in which lines were laid down, or the difference between two lines that meet at an angle compared with a single line that has a sharp corner in it. | + | La véritable différence apparaît clairement lorsque l'on examine de plus près les nœuds utilisés pour constituer les deux tracés. Le premier est un tracé fermé, rempli, et vous pouvez voir que les nœuds constituent la forme extérieure du trait. Le tracé de la ligne centrale, en revanche, donne lieu à un tracé ouvert constitué d'une simple ligne de nœuds : toute l' |
- | As is so often the case with the Trace Bitmap dialog, I can only recommend that you give it a try on your image, but don’t expect miracles. Even if the results aren’t perfect, it may save you some manual tracing time on part of your design, or at least give you a starting framework to build upon. | + | **What happens when you try this mode with a more complex example? How about a few handwritten letters? |
- | Next month, we’ll take a look at the new “Selectors | + | As you can see, the trace doesn’t really reflect |
+ | You may also have realised that such shapes can’t be made up of a single path segment. In this instance we’ve ended up with a single complex path consisting of all the different segments that make up the letters combined into one object. Path > Break Apart allows us to reduce the complex path down to its constituent parts, which we can then give different colors to demonstrate the paths that the algorithm settled on.** | ||
+ | Que se passe-t-il lorsque vous essayez ce mode avec un exemple plus complexe ? Que diriez-vous de quelques lettres manuscrites ? | ||
+ | Comme vous pouvez le constater, le tracé ne reflète pas vraiment les formes et le style d' | ||
+ | Vous avez peut-être aussi réalisé que de telles formes ne peuvent pas être composées d'un seul segment de trajectoire. Dans ce cas, nous nous sommes retrouvés avec un seul chemin complexe composé de tous les différents segments qui composent les lettres combinés en un seul objet. Chemin > Séparer nous permet de réduire le chemin complexe à ses parties constituantes, | ||
+ | **The A, not unreasonably, | ||
+ | You may think I’m being unfair on the algorithm here. My scanned text was from a thick Sharpie, rather than the thin strokes of a pencil or ballpoint pen. But based on my testing, you’ll likely face similar issues, even when starting with thinner lines in the source material. | ||
+ | That’s not to say that the new mode is useless or unwelcome. For many images it will prove to be far more effective than the existing tracing methods, especially if you’re interested in only the core shapes of the elements rather than the exact details of the stroke outlines. Just remember that it’s working only with pixels, and has no concept of the order in which lines were laid down, or the difference between two lines that meet at an angle compared with a single line that has a sharp corner in it.** | ||
+ | Le A, comme il se doit, est composé de trois trajectoires distinctes. Mais la complexité du B n'est saisie que par deux tracés : une ligne courbe complexe qui englobe la majeure partie de la forme de la lettre, et un petit segment droit pour combler l' | ||
+ | Vous pouvez penser que je suis injuste avec l' | ||
+ | Cela ne veut pas dire que ce nouveau mode est inutile ou malvenu. Pour de nombreuses images, il s' | ||
+ | **As is so often the case with the Trace Bitmap dialog, I can only recommend that you give it a try on your image, but don’t expect miracles. Even if the results aren’t perfect, it may save you some manual tracing time on part of your design, or at least give you a starting framework to build upon. | ||
+ | Next month, we’ll take a look at the new “Selectors and CSS” dialog, which promises to make Inkscape a little more useful as a web development tool.** | ||
+ | Comme c'est souvent le cas avec la boîte de dialogue Vectoriser un objet matriciel, je ne peux que vous recommander de l' | ||
+ | Le mois prochain, nous nous pencherons sur la nouvelle boîte de dialogue « Sélecteurs et CSS », qui promet de rendre Inkscape un peu plus utile en tant qu' | ||
- | Links | + | **Links |
Potrace: http:// | Potrace: http:// | ||
Ligne 86: | Ligne 133: | ||
Autotrace man page: https:// | Autotrace man page: https:// | ||
- | “Frankie” and other images: http:// | + | “Frankie” and other images: http:// |
+ | |||
+ | Liens | ||
+ | |||
+ | Potrace : http:// | ||
+ | |||
+ | Autotrace : http:// | ||
+ | https:// | ||
+ | |||
+ | Page du manuel d' | ||
+ | |||
+ | « Frankie » et les autres |
issue171/inkscape.1627838446.txt.gz · Dernière modification : 2021/08/01 19:20 de auntiee