issue113:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédente | Dernière révisionLes deux révisions suivantes | ||
issue113:inkscape [2016/10/08 11:25] – auntiee | issue113:inkscape [2016/10/08 11:54] – auntiee | ||
---|---|---|---|
Ligne 53: | Ligne 53: | ||
Pour commencer à comprendre cette primitive, débutons | Pour commencer à comprendre cette primitive, débutons | ||
- | Comme vous le voyez, la première entrée de Carte de déplacement est notre Source image, alors que la seconde vient de la primitive Image. En pratique, l' | + | Comme vous le voyez, la première entrée de Carte de déplacement est notre Source image, alors que la seconde vient de la primitive Image. En pratique, l' |
**The result of the filter is... absolutely nothing! To understand why, let's consider a single pixel in our output image. That pixel comes from somewhere in the source image, with the exact nature of “somewhere” being defined by the displacement map (the second input image). Each pixel in the displacement map is made up of a combination of four values (Red, Green, Blue and Alpha), and the settings in the filter dialog let you choose which of those values should be used for the X offset, and which for the Y offset. From there, Inkscape goes through the following steps to find out what color the output pixel should be: | **The result of the filter is... absolutely nothing! To understand why, let's consider a single pixel in our output image. That pixel comes from somewhere in the source image, with the exact nature of “somewhere” being defined by the displacement map (the second input image). Each pixel in the displacement map is made up of a combination of four values (Red, Green, Blue and Alpha), and the settings in the filter dialog let you choose which of those values should be used for the X offset, and which for the Y offset. From there, Inkscape goes through the following steps to find out what color the output pixel should be: | ||
Ligne 65: | Ligne 65: | ||
7) The output pixel should be set to the color of the pixel from the input image that is located at the new coordinates, | 7) The output pixel should be set to the color of the pixel from the input image that is located at the new coordinates, | ||
- | Le résultat du filtre est… absolument rien ! Pour comprendre pourquoi, considérons un seul pixel de notre image de sortie. Ce pixel vient de quelque part dans notre image d' | + | Le résultat du filtre est… absolument rien ! Pour comprendre pourquoi, considérons un seul pixel de notre image de sortie. Ce pixel vient de quelque part dans notre Source |
1) Chercher la couleur du pixel équivalent dans la carte de déplacement. | 1) Chercher la couleur du pixel équivalent dans la carte de déplacement. | ||
- | 2) Extraire les décalages X et Y des composantes de couleur | + | 2) Extraire les décalages X et Y des composantes de couleur |
3) Diviser les décalages par 255 pour les normaliser dans une plage de 0 à 1. | 3) Diviser les décalages par 255 pour les normaliser dans une plage de 0 à 1. | ||
- | 4) Soustraire 0.5 des décalages pour les déplacer dans la plage -0,5 à 0,5. | + | 4) Soustraire 0,5 des décalages pour les déplacer dans la plage -0,5 à 0,5. |
5) Multiplier les décalages par la valeur de Longueur/ | 5) Multiplier les décalages par la valeur de Longueur/ | ||
6) Ajouter les valeurs des décalages aux coordonnées X et Y du pixel pour obtenir une nouvelle paire de coordonnées. | 6) Ajouter les valeurs des décalages aux coordonnées X et Y du pixel pour obtenir une nouvelle paire de coordonnées. | ||
- | 7) Le pixel de sortie sera réglé à la couleur du pixel de l' | + | 7) Le pixel de sortie sera réglé à la couleur du pixel de l' |
**Bear in mind that our map consists only of 50% gray, with RGB values of 127, 127, 127. If you follow the steps above you'll find that gives an offset of about -0.02 pixels for both X and Y – close enough to zero to effectively mean that the output pixel is taken from the same position as the input pixel. Extend that over every pixel in the filter, and it's clear why our output looks exactly the same as the input. | **Bear in mind that our map consists only of 50% gray, with RGB values of 127, 127, 127. If you follow the steps above you'll find that gives an offset of about -0.02 pixels for both X and Y – close enough to zero to effectively mean that the output pixel is taken from the same position as the input pixel. Extend that over every pixel in the filter, and it's clear why our output looks exactly the same as the input. | ||
Ligne 81: | Ligne 81: | ||
Changing the rectangle to white (255, 255, 255) has the opposite effect – the image appears to move up and to the left. Because we've specified Red and Green for the X and Y displacement, | Changing the rectangle to white (255, 255, 255) has the opposite effect – the image appears to move up and to the left. Because we've specified Red and Green for the X and Y displacement, | ||
- | Gardez en tête que notre carte n'est que du gris à 50%, avec les valeurs RGB à 127, 127, 127. Si vous suivez les étapes ci-dessus, vous trouverez un décalage de -0,02 pixels pour X comme pour Y - assez proches de zéro pour signifier en fait que le pixel de sortie prend la même position que le pixel d' | + | Gardez en tête que notre carte n'est que du gris à 50%, avec les valeurs RGB à 127, 127, 127. Si vous suivez les étapes ci-dessus, vous trouverez un décalage de -0,02 pixels pour X comme pour Y - assez proches de zéro pour signifier en fait que le pixel de sortie prend la même position que le pixel d' |
- | Le changement du rectangle en noir (0, 0, 0) modifie quelque peu le calcul. Maintenant, le décalage devient -5, -5 ; aussi, notre pixel de sortie prend la couleur du pixel situé un peu au-dessus et un peu à gauche de l' | + | Le changement du rectangle en noir (0, 0, 0) modifie quelque peu le calcul. Maintenant, le décalage devient -5, -5 ; aussi, notre pixel de sortie prend la couleur du pixel situé un peu au-dessus et un peu à gauche de l' |
- | La modification du rectangle en blanc (255, 255, 255) a l' | + | La modification du rectangle en blanc (255, 255, 255) a l' |
**Used with a flat color like this, Displacement Map is just a very poor replacement for the Offset primitive. Where it comes into its own is when your displacement map contains various colors in order to use different offsets for each pixel. We know that a black fill pulls its pixels from up/left, and a white fill from down/right – what happens when we use an image with both black and white in it? Let's give it a try with a group, containing a black spiral on a white background – and we'll apply it to something a bit more complex than a red star. | **Used with a flat color like this, Displacement Map is just a very poor replacement for the Offset primitive. Where it comes into its own is when your displacement map contains various colors in order to use different offsets for each pixel. We know that a black fill pulls its pixels from up/left, and a white fill from down/right – what happens when we use an image with both black and white in it? Let's give it a try with a group, containing a black spiral on a white background – and we'll apply it to something a bit more complex than a red star. | ||
Ligne 92: | Ligne 92: | ||
It's a bit of a cheat, because using just red and green only “stretches” your image in two directions. Overlaying a circle with perpendicular gradient that runs from white to transparent to black gives a more accurate result, but does start to hint at the biggest problem with the Displacement Map primitive: creating a suitable map image for the effect you want to achieve isn't always easy or obvious. But there is one way of creating a map that's quite simple, and extremely useful: the Turbulence primitive.** | It's a bit of a cheat, because using just red and green only “stretches” your image in two directions. Overlaying a circle with perpendicular gradient that runs from white to transparent to black gives a more accurate result, but does start to hint at the biggest problem with the Displacement Map primitive: creating a suitable map image for the effect you want to achieve isn't always easy or obvious. But there is one way of creating a map that's quite simple, and extremely useful: the Turbulence primitive.** | ||
- | L' | + | L' |
- | En ajoutant un peu de Bruit gaussien entre la primitive Image et la Carte de déplacement, | + | En ajoutant un peu de Flou gaussien entre la primitive Image et la Carte de déplacement, |
- | C'est tricher un peu, car l' | + | C'est tricher un peu, car l' |
**If you need a refresher on this primitive, take a look at Part 51 of this series. In short, it's a fast way to create areas filled with pseudo-random colors which, when used as a distortion map, will pull your image this way and that as you tweak the parameters. Use a low frequency Fractal Noise setting to add grotesque distortions to your image. Crank up the values a little to produce the sort of modesty-providing distortions you might find in a bathroom window. Further still and you've got a pointillistic masterpiece of shattered pixels. Unlink the horizontal and vertical frequencies and you can have a fluttering flag, or horizontal ripples. | **If you need a refresher on this primitive, take a look at Part 51 of this series. In short, it's a fast way to create areas filled with pseudo-random colors which, when used as a distortion map, will pull your image this way and that as you tweak the parameters. Use a low frequency Fractal Noise setting to add grotesque distortions to your image. Crank up the values a little to produce the sort of modesty-providing distortions you might find in a bathroom window. Further still and you've got a pointillistic masterpiece of shattered pixels. Unlink the horizontal and vertical frequencies and you can have a fluttering flag, or horizontal ripples. | ||
Ligne 102: | Ligne 102: | ||
But make sure you take the time to look at the edges. And what edges they are! From slight undulations, | But make sure you take the time to look at the edges. And what edges they are! From slight undulations, | ||
- | Si vous avez besoin de vous rafraîchir la mémoire à propos de cette primitive, regardez | + | Si vous avez besoin de vous rafraîchir la mémoire à propos de cette primitive, regardez la partie 51 de cette série. En bref, c'est une façon rapide de créer des zones remplies de couleurs pseudo-aléatoires qui, quand elles sont utilisées dans une carte de déplacement, |
- | Mais prenez bien le temps de regarder | + | Mais prenez bien le temps de regarder les bords. Et quels bords ! Des ondulations légères, en passant par des éclaboussures d' |
**Image Credits | **Image Credits |
issue113/inkscape.txt · Dernière modification : 2016/10/08 14:43 de andre_domenech