issue81:inkscape_-_p._21
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue81:inkscape_-_p._21 [2014/06/05 14:51] – auntiee | issue81:inkscape_-_p._21 [2014/06/10 09:13] (Version actuelle) – [1] lecastillan | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
===== 1 ===== | ===== 1 ===== | ||
- | Over the past five instalments, | + | **Over the past five instalments, |
Seeking some variation in the outlines, I then proceeded to introduce a number of ways to trace the sketch, but they all suffered from one obvious omission: color. Although they introduced some dynamics to the image, they all resulted in the outline being rendered as a single filled path. The best looking result arguably came from automatically tracing an inked and cleaned-up version of the image (see part 19 for details), but that still produced only a nice looking outline consisting of a single complex path with over 1000 nodes. | Seeking some variation in the outlines, I then proceeded to introduce a number of ways to trace the sketch, but they all suffered from one obvious omission: color. Although they introduced some dynamics to the image, they all resulted in the outline being rendered as a single filled path. The best looking result arguably came from automatically tracing an inked and cleaned-up version of the image (see part 19 for details), but that still produced only a nice looking outline consisting of a single complex path with over 1000 nodes. | ||
- | Changing the fill on this image would just result in a colored outline. In order to color the drawing itself, it's necessary to create each area of color as a separate path that can be placed below the outline. In other words you have to manually re-draw each area of the image to create a set of paths that can be filled. If it sounds like a lot of extra work, that's because it is, but Inkscape does have a Paint Bucket tool that can help. | + | Changing the fill on this image would just result in a colored outline. In order to color the drawing itself, it's necessary to create each area of color as a separate path that can be placed below the outline. In other words you have to manually re-draw each area of the image to create a set of paths that can be filled. If it sounds like a lot of extra work, that's because it is, but Inkscape does have a Paint Bucket tool that can help.** |
- | Au cours des cinq derniers épisodes, nous avons utilisé Inkscape pour tracer - manuellement et de façon automatique - des images bitmap. Dans la partie 17, j'ai présenté l' | + | Au cours des cinq derniers épisodes, nous avons utilisé Inkscape pour tracer - manuellement et de façon automatique - des images bitmap. Dans la partie 17, j'ai présenté l' |
- | À la recherche de variations dans contours, j'ai alors présenté plusieurs façons de tracer l' | + | À la recherche de variations dans les contours, j'ai alors présenté plusieurs façons de tracer l' |
- | Si l'on changeait le remplissage de cette image, on n' | + | Si l'on changeait le remplissage de cette image, on n' |
===== 2 ===== | ===== 2 ===== | ||
- | The Paint Bucket – sometimes referred to as a Fill or Flood Fill tool – is commonly found in bitmap editors such as The GIMP, so you may already be familiar with its basic operation. In Inkscape, it's present in the main tool palette and can be selected using the Shift-F7 keyboard shortcut, by pressing the “u” key on the keyboard (easier to remember if you imagine it as a sort of bucket shape), or by clicking on the icon. | + | **The Paint Bucket – sometimes referred to as a Fill or Flood Fill tool – is commonly found in bitmap editors such as The GIMP, so you may already be familiar with its basic operation. In Inkscape, it's present in the main tool palette and can be selected using the Shift-F7 keyboard shortcut, by pressing the “u” key on the keyboard (easier to remember if you imagine it as a sort of bucket shape), or by clicking on the icon. |
Once selected, clicking the mouse inside a “bounded region” in your drawing will create a path that fills it with the currently selected fill and stroke. In simple terms, a bounded region just means an area of a single color that is completely surrounded by a differently colored border, with no breaks. In practice the color of the border must be significantly different from the area you are filling. | Once selected, clicking the mouse inside a “bounded region” in your drawing will create a path that fills it with the currently selected fill and stroke. In simple terms, a bounded region just means an area of a single color that is completely surrounded by a differently colored border, with no breaks. In practice the color of the border must be significantly different from the area you are filling. | ||
- | The region to be filled is actually calculated based on the color of each pixel in the area, so it's a bitmap operation rather than a vector one. The pixel you click on is taken as the starting point, then the algorithm tries to expand outwards by considering adjacent pixels. If a pixel' | + | The region to be filled is actually calculated based on the color of each pixel in the area, so it's a bitmap operation rather than a vector one. The pixel you click on is taken as the starting point, then the algorithm tries to expand outwards by considering adjacent pixels. If a pixel' |
+ | L' | ||
+ | |||
+ | Une fois l' | ||
+ | |||
+ | La zone à remplir est en fait calculée sur la couleur de chacun de ses pixels et il s'agit ainsi d'une opération bitmap plutôt qu'une opération vectorielle. Le pixel sur lequel vous cliquez est censé être le point de départ ; ensuite l' | ||
===== 3 ===== | ===== 3 ===== | ||
- | If all that talk of algorithms has got you confused, a simpler way to imagine it is as though you're trying to pour ink into a shallow dish. The ink will spread out along the base of the dish – but only where the base is flat and even enough – and stop when it reaches the edges. Similarly the bucket-fill algorithm tries to spread the fill region out – where the colors are similar enough – and stops when it reaches the contrasting boundary. | + | **If all that talk of algorithms has got you confused, a simpler way to imagine it is as though you're trying to pour ink into a shallow dish. The ink will spread out along the base of the dish – but only where the base is flat and even enough – and stop when it reaches the edges. Similarly the bucket-fill algorithm tries to spread the fill region out – where the colors are similar enough – and stops when it reaches the contrasting boundary. |
Taking a closed star as our object to be filled, zooming it to fill the screen, then clicking anywhere in the white interior, will produce something like this: | Taking a closed star as our object to be filled, zooming it to fill the screen, then clicking anywhere in the white interior, will produce something like this: | ||
- | In this case the tool was set to a dark red fill and no stroke, and we've managed to create a new path which approximately fills the outline. It's only approximate because the new path doesn' | + | In this case the tool was set to a dark red fill and no stroke, and we've managed to create a new path which approximately fills the outline. It's only approximate because the new path doesn' |
+ | |||
+ | Si toutes ces références aux algorithmes vous ont plongé dans la confusion, imaginez que vous essayez de verser de l' | ||
+ | |||
+ | Choisir une étoile fermée comme objet à remplir, l' | ||
+ | |||
+ | Ici, l' | ||
+ | |||
Ligne 33: | Ligne 46: | ||
- | As our aim is to color a comic sketch, it's the middle option – a positive grow/shrink value – that interests us at this stage. As you can see, the new path extends well into the border but we can send it to the back of the z-index, bring the outline to the front, or draw our color fills on a lower layer, to give us our original outline with the appearance of a filled interior. It's a quick and easy way to fill some of the larger areas of a character like Frankie. | + | **As our aim is to color a comic sketch, it's the middle option – a positive grow/shrink value – that interests us at this stage. As you can see, the new path extends well into the border but we can send it to the back of the z-index, bring the outline to the front, or draw our color fills on a lower layer, to give us our original outline with the appearance of a filled interior. It's a quick and easy way to fill some of the larger areas of a character like Frankie. |
It's not a bad start, but there are a few problems. Some of the fills don't quite get into all the corners, or leave gaps near the outlines, and the bucket fill didn't work at all on the jumper and the nut on the right hand side. Let's start by looking at the fill for the face in isolation, temporarily changing the color so it stands out a little more. | It's not a bad start, but there are a few problems. Some of the fills don't quite get into all the corners, or leave gaps near the outlines, and the bucket fill didn't work at all on the jumper and the nut on the right hand side. Let's start by looking at the fill for the face in isolation, temporarily changing the color so it stands out a little more. | ||
- | There are 96 nodes in this path, but many of them aren't really necessary. We don't need it to follow the outline of the mouth and nose, and we certainly don't need to trace every bit of stubble. Even the eyes aren't necessary as we can simply stack their own bucket-filled paths on top of the face path. With a bit of node editing it's easy to simplify this complex path. Adding and subtracting rectangles, ellipses or other paths using the Boolean operations is a quick way to deal with lots of nodes at once. In this case I'll simply draw an approximate path using the Bézier tool (shown in green), then use Path > Union to combine it with the face. | + | There are 96 nodes in this path, but many of them aren't really necessary. We don't need it to follow the outline of the mouth and nose, and we certainly don't need to trace every bit of stubble. Even the eyes aren't necessary as we can simply stack their own bucket-filled paths on top of the face path. With a bit of node editing it's easy to simplify this complex path. Adding and subtracting rectangles, ellipses or other paths using the Boolean operations is a quick way to deal with lots of nodes at once. In this case I'll simply draw an approximate path using the Bézier tool (shown in green), then use Path > Union to combine it with the face.** |
+ | |||
+ | Puisque notre objectif est de colorer une esquisse humoristique, | ||
+ | |||
+ | Ce n'est pas un mauvais début, mais il y a quelques problèmes. Quelques-uns des remplissages n' | ||
+ | |||
+ | Ce chemin contient 96 nœuds, mais beaucoup d' | ||
===== 5 ===== | ===== 5 ===== | ||
- | Putting this path back into place shows that there are still some gaps around the edges. We can correct this just by dragging a few nodes and handles into position – with the path now significantly simplified this is a much easier job than it would have been previously. | + | **Putting this path back into place shows that there are still some gaps around the edges. We can correct this just by dragging a few nodes and handles into position – with the path now significantly simplified this is a much easier job than it would have been previously. |
The bucket tool often has a problem with concave corners. One way to reduce the issue is to zoom in on the object you're filling. This results in more pixels being used in the flood algorithm, giving a more accurate fill. Unfortunately it only works for small objects because the whole, unbroken boundary has to be visible in the Inkscape drawing window, or at least only slightly outside it. Otherwise you can fill at a low zoom level, then get in closer and fill again to finish off the corners. If the first fill is still selected you can hold Shift to cause the second fill to be added to the same path, or you can simply create them as two paths then use Path > Union to merge them into one. Most commonly, though, it's easiest just to do a little manual node editing to get the path to fill the corners. | The bucket tool often has a problem with concave corners. One way to reduce the issue is to zoom in on the object you're filling. This results in more pixels being used in the flood algorithm, giving a more accurate fill. Unfortunately it only works for small objects because the whole, unbroken boundary has to be visible in the Inkscape drawing window, or at least only slightly outside it. Otherwise you can fill at a low zoom level, then get in closer and fill again to finish off the corners. If the first fill is still selected you can hold Shift to cause the second fill to be added to the same path, or you can simply create them as two paths then use Path > Union to merge them into one. Most commonly, though, it's easiest just to do a little manual node editing to get the path to fill the corners. | ||
+ | ide | ||
+ | Taking a closer look at the nut and bolt, it's clear that the problem here is a gap in the sketch which means we don't have a completely bounded region to fill.** | ||
- | Taking a closer look at the nut and bolt, it's clear that the problem here is a gap in the sketch which means we don't have a completely bounded region to fill. | + | En remettant ce chemin en place, nous voyons qu'il reste encore quelques vides autour des bords. Nous pouvons corriger ceci en glissant quelques nœuds et poignées à la position qu'il faut - maintenant que le chemin |
+ | |||
+ | L' | ||
+ | |||
+ | En regardant le boulon et l' | ||
===== 6 ===== | ===== 6 ===== | ||
- | If your boundary has small gaps in it, then don't despair: the bucket fill tool has a “Close gaps” option on the tool control bar that allows it to automatically deal with such issues. This feature can be set to close small, medium or large gaps, or turned off entirely. Be aware that closing gaps might also prevent it filling legitimate parts of the drawing if you have a complex boundary that pinches together in some areas. Even the “large” setting only closes gaps of a few pixels in size, so you may find it works only if you zoom out a bit – which in turn gives you less accuracy in the corners. | + | **If your boundary has small gaps in it, then don't despair: the bucket fill tool has a “Close gaps” option on the tool control bar that allows it to automatically deal with such issues. This feature can be set to close small, medium or large gaps, or turned off entirely. Be aware that closing gaps might also prevent it filling legitimate parts of the drawing if you have a complex boundary that pinches together in some areas. Even the “large” setting only closes gaps of a few pixels in size, so you may find it works only if you zoom out a bit – which in turn gives you less accuracy in the corners. |
An alternative approach is to manually close the gaps. Remember that the fill algorithm is concerned only with how different each pixel' | An alternative approach is to manually close the gaps. Remember that the fill algorithm is concerned only with how different each pixel' | ||
- | Manually plugging gaps lets you use the bucket fill while still being zoomed in close enough for it to get into the corners. In this case, however, there are enough separate areas that some extra manual work would be needed to color it all anyway, so it's just as easy to manually fill the whole shape. By using the Bézier tool to lay down straight lines that follow the center of the outline it's quite simple to color a small region such as this. Once the Bézier path has been drawn, sending it to the back will hide the straight edges behind the outline to retain the hand drawn final appearance. | + | Manually plugging gaps lets you use the bucket fill while still being zoomed in close enough for it to get into the corners. In this case, however, there are enough separate areas that some extra manual work would be needed to color it all anyway, so it's just as easy to manually fill the whole shape. By using the Bézier tool to lay down straight lines that follow the center of the outline it's quite simple to color a small region such as this. Once the Bézier path has been drawn, sending it to the back will hide the straight edges behind the outline to retain the hand drawn final appearance.** |
+ | |||
+ | Si la limite de votre zone a quelques petits vides, ne désespérez pas : il y a une option « Combler les vides : » sur la barre de contrôle de l' | ||
+ | |||
+ | Une autre approche serait de combler les vides à la main. Souvenez-vous que l' | ||
+ | |||
+ | Combler les vides à la main vous permet d' | ||
===== 7 ===== | ===== 7 ===== | ||
- | The bucket fill tool also has a few other tricks up its sleeve. Because it works on pixel values, it can be used to fill areas of a bitmap image, even without tracing it first. In that case the background color can often be less than uniform due to artifacts introduced with JPEG compression, | + | **The bucket fill tool also has a few other tricks up its sleeve. Because it works on pixel values, it can be used to fill areas of a bitmap image, even without tracing it first. In that case the background color can often be less than uniform due to artifacts introduced with JPEG compression, |
You can also change the basic rule of the algorithm entirely using the “Fill by” pop-up menu. Instead of looking for general changes in pixels' | You can also change the basic rule of the algorithm entirely using the “Fill by” pop-up menu. Instead of looking for general changes in pixels' | ||
- | After another manually drawn path for his jumper, and a little node work to remove and re-create the veins in his brain, it's finally time to reveal the finished version of Frankie. Having to separately color each section of a sketch can certainly be time consuming, but if you compare this version with the simple manual trace presented at the start, I hope you'll agree that the extra effort required to maintain some variation in the outline has been worth it. Whilst the manual trace has a decidedly vector feel to the image, this final version retains a lot more of the hand-drawn style. | + | After another manually drawn path for his jumper, and a little node work to remove and re-create the veins in his brain, it's finally time to reveal the finished version of Frankie. Having to separately color each section of a sketch can certainly be time consuming, but if you compare this version with the simple manual trace presented at the start, I hope you'll agree that the extra effort required to maintain some variation in the outline has been worth it. Whilst the manual trace has a decidedly vector feel to the image, this final version retains a lot more of the hand-drawn style.** |
+ | |||
+ | L' | ||
+ | |||
+ | Vous pouvez également changer complètement la règle de base de l' | ||
+ | |||
+ | Après un autre chemin fait main pour le cavalier et un peu de travail sur les nœuds pour enlever et recréer les veines dans son cerveau, le moment est enfin venu de révéler la version finie de Frankie. Devoir colorer chaque section d'une esquisse peut prendre beaucoup de temps, il est vrai, mais si vous comparez cette version au traçage manuel simple présenté au départ, j' |
issue81/inkscape_-_p._21.1401972683.txt.gz · Dernière modification : 2014/06/05 14:51 de auntiee