Ceci est une ancienne révision du document !
1
Last time I traced a sketch of my comic strip character, “Frankie”, using the Bézier tool. First I used the standard SVG stroke, which creates a smooth outline of constant width. Then I converted the stroke to a path in order to vary the width of the outline manually. Finally I used Inkscape's “Shape” option to create variable width outlines. In addition to the Bézier tool, Inkscape offers a couple of other methods for drawing variable width outlines. I've split these out into their own article because, in my experience, they both particularly benefit users of graphics tablets and can be difficult to use effectively with a mouse. The first is referred to variously as the Pencil tool or the Freehand tool. The keyboard shortcut, on English versions of Inkscape at least, is either F6 or “P” – so “Pencil tool” is a better mnemonic.
La dernière fois, j'ai tracé une esquisse de mon personnage de bande dessinée, « Frankie », à l'aide de l'outil de Bézier. Tout d'abord, j'ai utilisé le trait standard SVG, qui crée un contour lisse de largeur constante. Puis j'ai converti le trait en un chemin pour faire varier la largeur du contour manuellement. Enfin, j'ai utilisé option « Shape » d'Inkscape pour créer des contours de largeur variable.
En plus de l'outil de Bézier, Inkscape offre deux autres méthodes pour dessiner des contours de largeur variable. Je les ai séparées dans leur propre article, parce que, d'après mon expérience, toutes deux bénéficient particulièrement aux utilisateurs de tablettes graphiques et peuvent être difficiles à utiliser efficacement avec une souris. La première est dénommée indifféremment le crayon (Pencil Tool) ou l'outil de dessin à main levée (Freehand tool). Le raccourci clavier, au moins sur les versions anglaises de Inkscape, est F6 ou « P » ( donc « Pencil tool» est un meilleur moyen mnémotechnique).
The Pencil tool (left) is best thought of as a freehand version of the Bézier tool. With the latter you place nodes at specific locations and Inkscape draws a path that connects them. With the Pencil tool, however, you draw a path and Inkscape places the nodes for you. The few items on the Pencil tool's control bar are very similar to those of the Bézier tool: you still have the Shape pop-up, with its limited list of options, if you want some variability in the path's width; but you also have a “Smoothing” control that's specific to this tool. When you draw a line using the Pencil tool, the Smoothing value determines how accurately the final path will follow your scribbles. Setting this to a low value will create a path with lots of nodes which accurately records every bump and hiccup that you make as you draw your line. Conversely setting this all the way up to 100 will result in a path that only honors the start and end points of your line, with a curve that vaguely corresponds to the direction of your movements.
Il est mieux de penser à l'outil crayon (à gauche) comme étant une version à main levée de l'outil de Bézier. Avec ce dernier vous placez des nœuds à des emplacements spécifiques et Inkscape dessine un chemin qui les relie. Avec le crayon, cependant, vous dessinez un tracé et Inkscape met les nœuds pour vous. Les quelques éléments sur la barre de contrôle de l'outil crayon sont très semblables à celles de l'outil de Bézier : vous avez toujours le pop-up de forme (Shape), avec sa liste limitée d'options, si vous voulez une variabilité dans la largeur du trait; mais vous avez aussi un contrôle de « Lissage » spécifique à cet outil (Smoothing).
Lorsque vous dessinez une ligne à l'aide du crayon, la valeur de lissage détermine la précision avec laquelle le chemin final suivra votre griffonnage. Lui donner une valeur faible créera un chemin avec beaucoup de nœuds qui enregistre avec précision chaque bosse et hoquet que vous faites lorsque vous dessinez votre ligne. À l'inverse paramétrer tout le chemin à 100 se traduira par un chemin qui n'honore que le départ et l'arrivée de votre ligne, avec une courbe qui correspond vaguement à la direction de vos mouvements.
2
This example shows my efforts to trace Frankie's nose using a mouse, with the Smoothing set to 1, 25, 50, 75 and 100. The paths clearly become smoother with each increase in value, but in doing so, the finer detail of the shape is lost. By checking the status bar when each path is selected, the reason becomes clear: increased smoothing results in fewer nodes in the path. In this case the paths have 548, 70, 8, 4 and 2 nodes respectively. I find that it's usually easier to produce a smooth line with a graphics tablet than with a mouse, so stylus users may be able to get away with a lower smoothness value and still produce acceptable results. Remember that you can always simplify the path using CTRL-L, so it's often better to keep the smoothness value a little on the low side, and tidy up the results afterwards.
Cet exemple montre mes efforts pour tracer le nez de Frankie à l'aide d'une souris, avec le lissage défini à 1, 25, 50, 75 et 100. Les chemins deviennent nettement plus lisses avec chaque augmentation de valeur, mais ce faisant, le détail plus fin de la forme est perdu. En vérifiant la barre d'état lorsque chaque chemin est sélectionné, la raison devient claire: un lissage augmenté se traduit en moins de nœuds dans le chemin. Dans ce cas les chemins ont 548, 70, 8, 4 et 2 nœuds respectivement.
Je trouve qu'il est généralement plus facile de produire une ligne lisse avec une tablette graphique qu'avec une souris, donc les utilisateurs de stylet peuvent être capables de s'en tirer avec une valeur inférieure de lissage et de toujours produire des résultats acceptables. N'oubliez pas que vous pouvez toujours simplifier le chemin en utilisant CTRL-L, il est souvent préférable de conserver la valeur de lissage un peu vers le bas et arranger les résultats par la suite.
One very satisfying use of this tool – at least for those of us who can't draw particularly well – is to set the smoothness fairly high and the shape to “ellipse”, then freely sketch with a stylus or mouse. The smoothing turns your jittery paths into swooping impressions, and the ellipse shape gives something of a brushwork feel to the image. You probably won't sell the results at a gallery, but it does make for a quick and easy way to create a rough sketch that you can then refine using other tools. Here you can see the results of two minutes spent playing with a graphics tablet – I'm sure many readers will be able to do much better. Whereas all the options for the Pencil tool can be used with a mouse, the Calligraphy tool (CTRL-F6 or “c”) has options that are available only if you use a graphics tablet. To be able to use all its features requires a tablet and stylus that measures both pressure and tilt angle – effectively limiting the tool for anyone who doesn't have an expensive Wacom tablet. The tool can still be used with a cheaper tablet, or even with a mouse, but not all the features will be available.
Une utilisation très satisfaisante de cet outil, du moins pour ceux d'entre nous qui ne peuvent pas dessiner particulièrement bien, est de définir le lissage assez élevé et la forme à « ellipse », puis dessiner librement avec un stylet ou une souris. Le lissage va transformer vos chemins nerveux en impressions de descente en piqué, et la forme de l'ellipse donne à l'image une sensation de travail au pinceau. Vous ne vendrez probablement pas le résultat dans une galerie, mais c'est une manière rapide et facile de créer une esquisse que vous pouvez ensuite affiner à l'aide d'autres outils. Ici vous pouvez voir le résultat de deux minutes passées à jouer avec une tablette graphique; je suis sûr que beaucoup de lecteurs seront en mesure de faire beaucoup mieux.
Tandis que toutes les options du crayon peuvent être utilisées avec une souris, l'outil Calligraphie (CTRL-F6 ou « c ») a des options qui ne sont disponibles que si vous utilisez une tablette graphique. Pouvoir utiliser toutes ses fonctionnalités nécessite une tablette et un stylet qui mesurent à la fois la pression et l'angle d'inclinaison; ce qui limite efficacement l'outil à quiconque n'ayant pas une tablette chère Wacom. L'outil peut toujours être utilisé avec une tablette moins chère, ou même avec une souris, mais toutes les fonctionnalités ne seront pas disponibles.
3
The Calligraphy tool (left) does not produce simple, clean Bézier curves. Instead, it produces complex filled paths that often have hundreds of nodes. Making a change to a path drawn with this tool is not for the faint hearted. The control bar (above) has a lot of buttons, sliders and options, reflecting the complexity of this tool and the range of effects it can produce. A good starting point is the selection of presets. These can be found in the pop-up menu on the left, offering presets called “Dip Pen”, “Marker”, “Brush”, “Wiggly”, “Splotchy” and “Tracing”. The last option, “Save…” allows you to add your own choice of settings as a preset. As you can see from this image, the first four presets give quite different effects. These were scribbled using a cheap graphics tablet that tracks pressure but not tilt angle. You can see that increasing the pressure as the line moves from top to bottom results in thicker lines for three of the presets – “Marker” pays no attention to pressure.
L'outil de calligraphie (à gauche) ne produit pas de courbes de Bézier simples et propres. Au lieu de cela, il produit des chemins complexes pleins qui ont souvent des centaines de nœuds. Faire un changement à un chemin dessiné avec cet outil n'est pas pour les âmes sensibles. La barre de contrôle (ci-dessus) a beaucoup de boutons, de curseurs et d'options, ce qui reflète la complexité de cet outil et la gamme des effets qu'il peut produire.
Un bon point de départ est la sélection de préréglages (presets). Ceux-ci peuvent être trouvés dans le menu déroulant sur la gauche, qui offre les préréglages appelés « Dip Pen » (Plume), « Marker » (Marqueur), « Brush » (Brosse), « Wiggly » (Ondulé), « Splotchy » (barbouillé) et « Tracing » (traceur). La dernière option, « Save… » vous permet d'ajouter votre propre choix de paramètres en tant que préréglage. Comme vous pouvez le voir sur cette image, les quatre premiers préréglages donnent des effets très différents. Ils ont été griffonnés à l'aide d'une tablette graphique pas chère qui permet de suivre la pression mais pas l'angle d'inclinaison. Vous pouvez voir que augmenter la pression tandis que la ligne se déplace de haut en bas, produit des lignes plus épaisses pour trois des préréglages, « Marker » ne fait pas attention à la pression.
I've omitted the “Splotchy” preset from that collection because I think it's fairly useless with its default settings. In particular, the width slider is set all the way up at 100, which results in extremely thick line ends that are too large for practical use. Dragging the width down to a lower value produces a far more usable result – but then it's no longer “Splotchy” and you may as well just save your own preset with a different name. In this test image, the black line uses the standard Splotchy width of 100, whereas the red line is set to 25. One thing to note is that this preset doesn't use the tablet's pressure – the thinning of the lines is dictated by the speed at which you draw. The final preset, “Tracing”, does something a little different to the others. Rather than the thickness of the line being dependent purely on how you draw, it also depends on what else is on the canvas when you draw. As you draw over darker objects, the line will become thicker, and over lighter objects it will be thinner. Unfortunately it never quite drops to zero, so you'll always have thin wispy lines even on the whitest of backgrounds. Here's an example in which I've just scribbled over my scan of Frankie. While my scribbles are over the white background, the line width is at its minimum, but as soon as I hit part of the character the line width thickens, resulting in a blobby approximation of the image beneath.
J'ai omis le préréglage « Splotchy » de cette collection, car je pense qu'il est assez inutile avec ses paramètres par défaut. En particulier, le curseur de largeur est fixé sur tout le chemin à 100, ce qui entraine des bouts de lignes extrêmement épais qui sont trop gros pour une utilisation pratique. Faire descendre la largeur à une valeur inférieure produit un résultat beaucoup plus utilisable; mais alors ce n'est plus « Splotchy » (barbouillé) et vous pouvez aussi bien enregistrer votre propre préréglage avec un nom différent. Dans cette image de test, la ligne noire utilise la largeur Splotchy standard de 100, alors que la ligne rouge est fixée à 25. Une chose à noter est que ce préréglage n'utilise pas la pression de la tablette; l'amincissement des lignes est dicté par la vitesse à laquelle vous dessinez.
Le préréglage final, « Tracing », fait quelque chose d'un peu différent des autres. Plutôt que de faire dépendre l'épaisseur de la ligne purement de comment vous dessinez, elle dépend aussi de ce qui est déjà sur la page. Lorsque vous dessinez dessus des objets plus sombres, la ligne devient plus épaisse, et sur des objets plus légers, elle sera plus mince. Malheureusement, il ne descend jamais tout à fait à zéro, donc vous aurez toujours des traits fins vaporeux même sur le plus blanc des arrière-plans. Voici un exemple dans lequel j'ai juste griffonné sur mon scan de Frankie. Alors que mes gribouillages sont sur un fond blanc, la largeur de la ligne est à son minimum, mais dès que j'ai touché la partie du personnage la largeur de la ligne s'épaissit, ce qui entraîne l'approximation floue de l'image ci dessous.
4
Although the presets give a good idea of the range of effects that can be produced with the Calligraphy tool, you can, of course, tweak the controls to create your own individual pens and brushes, then save your favourites as presets. Unfortunately, there's no way to delete a preset within Inkscape, but if you really need to remove one you can edit the Inkscape preferences file in a text editor to delete the relevant section of XML data. On a Linux system, the file is ~/.config/inkscape/preferences.xml, and if you search for the name of your preset you'll find a section that looks something like this: <group id=“dcc7” width=“44” mass=“0” wiggle=“0” angle=“30” thinning=“30” tremor=“10” flatness=“0” cap_rounding=“1” usepressure=“0” tracebackground=“0” usetilt=“1” name=“Medium Splotchy” />
Bien que les préréglages donnent une bonne idée de l'éventail des effets qui peuvent être produits avec l'outil de calligraphie, vous pouvez, bien sûr, régler les commandes pour créer vos propres stylets et pinceaux, puis enregistrer vos favoris comme préréglages. Malheureusement, il n'y a aucun moyen de supprimer un préréglage dans Inkscape, mais si vous voulez vraiment en retirer un, vous pouvez modifier le fichier de préférences d'Inkscape dans un éditeur de texte pour détruire la section correspondante de données XML. Sur un système Linux, le fichier est ~/.config/inkscape/preferences.xml, et si vous recherchez le nom de votre préréglage, vous trouverez une section qui ressemble à ceci :
<group
id="dcc7" width="44" mass="0" wiggle="0" angle="30" thinning="30" tremor="10" flatness="0" cap_rounding="1" usepressure="0" tracebackground="0" usetilt="1" name="Medium Splotchy" />
With all copies of Inkscape closed, first make a backup of the file, just in case. Then remove everything from the opening “<group” string to the closing “/>”. Make sure not to delete parts of the other “group” sections around it. Finally, save the file. When you next start Inkscape you should find that the preset has gone. After the presets pop-up, the next widget on the tool control bar is a slider to alter the nominal width of the line. As with other sliders in Inkscape, there's a right-click context menu with some presets, but usually it's easier to just drag the slider to approximately the width you want. The reason this is only a nominal value is that the line's thickness can be changed by any or all of the next three controls on the bar.
Toutes les instances d'Inkscape fermées, faire tout d'abord une sauvegarde du fichier, juste au cas où. Tout supprimer depuis l'ouverture « <group » à la fermeture « /> ». Veillez à ne pas supprimer des parties des autres sections « groupe » autour. Enfin, enregistrez le fichier. Lors du prochain démarrage d'Inkscape, vous devriez trouver que le préréglage est parti.
Après le menu des préréglages, le widget suivant sur la barre d'outils contrôle est un curseur pour modifier la largeur nominale de la ligne. Comme avec les autres curseurs dans Inkscape, il y a un menu contextuel avec des préréglages, mais le plus souvent il est plus facile de faire glisser le curseur à environ la largeur de votre choix. Il s'agit seulement d'une valeur nominale parce que l'épaisseur de la ligne peut être changé par n'importe lequel des trois contrôles suivants de la barre.
5
The first button switches pressure sensitivity on, which is useful only if you have a tablet that reports pressure. With this enabled, light pressure on the stylus will produce thinner lines, and strong pressure will produce thicker lines – but only up to the value set by the width slider. The second switches on the feature we saw with the “Tracing” preset whereby the line thickness changes depending on the darkness of the objects you're drawing over. Tracing over light objects will create a thinner line, while tracing over dark objects will create a thicker line. Tracing over a black object will result in the thickest line – the size set by the width slider. This image shows a line with a width of 50 drawn over a white-to-black gradient with the tracing option first disabled and then enabled.
Le premier bouton active la sensibilité à la pression, ce qui est utile uniquement si vous avez une tablette qui relève la pression. En activant cette option, une légère pression sur le stylet produira des lignes plus fines, et forte pression va produire des lignes plus épaisses; mais seulement jusqu'à la valeur définie par le curseur de largeur.
Le second active la fonction que nous avons vu avec le préréglage « Tracing », avec lequel l'épaisseur de la ligne change en fonction de l'obscurité des objets sur lesquels vous dessinez. Tracer par dessus des objets clairs créera une ligne plus mince, tandis que sur des objets sombres créera une ligne plus épaisse. Tracer sur un objet noir se traduira par la ligne la plus épaisse de taille définie par le curseur largeur. Cette image montre une ligne d'une largeur de 50 dessinée sur un dégradé de blanc à noir, avec l'option de traçage d'abord désactivée, puis activée.
The “Thinning” control could equally have been called “Fattening”, as it can produce either effect. For any non-zero value, the line thickness is changed according to how quickly you are drawing. Positive values will reduce the thickness, negative values will increase it. Again there is a context menu with some sensible values. This feature is most commonly used with positive values to simulate a brush or fountain pen, where fast strokes tend to produce thinner lines as less paint or ink is deposited on the page. The next three controls on the toolbar all need to be considered together. They alter the angle of the simulated calligraphy nib that is at the heart of this tool. Think about the wide, flat shape of a broad nibbed fountain pen, and about the effect that has on the line you draw. By changing the angle of the pen, you affect the shape of the line, and these controls attempt to mimic that.
6
The first directly sets the angle of the nib between -90° and +90°. If you have a suitably professional tablet, you can enable the button to the right of the Angle control to allow the nib's angle to be set by the tilt of the stylus. But it's the third control, “Fixation”, which affects the line the most. With this set at zero the angle is constantly changed to match the direction you're drawing in – resulting in a fixed thickness of line. With Fixation at 100 the angle is entirely set by the Angle spinbox and Tilt button – resulting in a line that is thick when drawn perpendicular to the nib angle, and thin when drawn parallel to it. Setting this control to values in-between affects how much of the angle is governed by the direction of the stroke, and how much by the Angle and Tilt controls. The best way to get a feel for the Angle and Fixation controls is simply to experiment with them. As usual they have context menus, and selecting the menus' default values of 30° angle and 90 for the fixation produces a passable fountain pen style for signatures or calligraphic flourishes.
The Caps control allows you to define how rounded the ends of your lines will appear. A value of zero will produce a square line end, with increasing values making the ends bulge out to semicircles, and ultimately to long ellipses. As usual the context menu has some sensible default values labelled, the effects of which you can see in this example. Finally we come to the Tremor, Wiggle and Mass controls. Let's get Mass out of the way quickly, as it's the least useful of the three. Essentially it tries to simulate some inertia in your calligraphy pen, by making the line you draw lag a little behind your mouse or stylus movements. It can help to smooth out erratic hand movements, much like the Smoothing control of the Pencil tool. Unfortunately, the range of values far exceeds anything that is likely to be useful. Although you can drag this control all the way up to 100, anything over about 10 results in so much lag that it's almost impossible to produce the shape you want, rendering 90% of the scale essentially useless!
7
Tremor and Wiggle are far more useful controls. On the surface they both produce similar results – adding some degree of randomness to your line. But whereas Tremor introduces randomness in the thickness of your line, Wiggle randomizes the position a little – wiggling the line up and down. The two are both dramatically affected by the speed with which you draw and can, of course, be combined to introduce a large amount of randomness. The Calligraphy tool can produce some interesting artistic effects, especially when used with a graphics tablet, but the results can be very difficult to edit. Consider something as simple as a little swirl, drawn with a stylus:
The version on the left is a simple Bézier path with a stroke, drawn using the Pencil tool. The one on the right was drawn with the Calligraphy tool, and is a filled path. The difference becomes clear if you look at the status bar, or switch to node editing mode – whilst the Pencil tool has produced a simple path with only four nodes, the Calligraphy tool has resulted in 42! The Pencil and Calligraphy tools both add more options to your arsenal when using Inkscape to manually trace an image. They can, of course, also be used as creative tools in their own right – especially if you have a graphics tablet and some artistic talent. For those of us with very little artistic talent, however, I'll be delving into Inkscape's tools for automatically tracing bitmaps in the next instalment.