issue116:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue116:inkscape [2017/01/02 15:42] – créée auntiee | issue116:inkscape [2017/01/07 15:05] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | There' | + | **There' |
A single color channel of a single pixel is represented by a number from 0 (no color) to 255 (completely saturated). The distribution of the values is linear – ramping up along a straight line – and the default settings for the Component Transfer primitive leave this line untouched. A value of 0 into the filter results in 0 out. 136 in gives 136 out. And so on. This can be represented as a graph, where the value of the channel coming into the filter is shown on the x-axis, and the value that comes out of the filter is shown on the y-axis. | A single color channel of a single pixel is represented by a number from 0 (no color) to 255 (completely saturated). The distribution of the values is linear – ramping up along a straight line – and the default settings for the Component Transfer primitive leave this line untouched. A value of 0 into the filter results in 0 out. 136 in gives 136 out. And so on. This can be represented as a graph, where the value of the channel coming into the filter is shown on the x-axis, and the value that comes out of the filter is shown on the y-axis. | ||
- | In practice, this primitive maps the input values to a range from 0 to 1 rather than 0 to 255, but the result is the same: with the default settings in the filter (“Identity”), | + | In practice, this primitive maps the input values to a range from 0 to 1 rather than 0 to 255, but the result is the same: with the default settings in the filter (“Identity”), |
- | Basic mathematics tells us that a straight line graph like this can be defined by the slope of the line and the point at which it intercepts with the y-axis. One way to modify the mapping, therefore, is to alter the slope and the intercept point – a pair of values provided by the “Linear” option in the filter. The identity line has a slope of 1 – that is, for every increase of 1 along the x axis, the y value also increases by 1. By setting it to a value of 2 we can make the slope steeper, causing the output to appear brighter. Here's how it looks for one channel in the filter dialog: | + | Il reste une dernière primitive de filtrage à visiter dans cette série, que j'ai gardée jusqu' |
+ | |||
+ | Une couleur unique d'un seul pixel est représentée par un nombre de 0 (pas de couleur) à 255 (complètement saturée). La distribution de ces valeurs est linéaire - augmentant le long d'une ligne droite - et les valeurs par défaut de la primitive Transfert de composantes laissent cette ligne inchangée. Une valeur de 0 dans le filtre entraîne une sortie à 0. 136 donne une sortie à 136. Et ainsi de suite. Ceci peut être représenté dans un graphique, où la valeur du canal entrant dans le filtre est présenté sur l'axe x, et la valeur qui sort du filtre est visible sur l'axe y. | ||
+ | |||
+ | En pratique, | ||
+ | |||
+ | **Basic mathematics tells us that a straight line graph like this can be defined by the slope of the line and the point at which it intercepts with the y-axis. One way to modify the mapping, therefore, is to alter the slope and the intercept point – a pair of values provided by the “Linear” option in the filter. The identity line has a slope of 1 – that is, for every increase of 1 along the x axis, the y value also increases by 1. By setting it to a value of 2 we can make the slope steeper, causing the output to appear brighter. Here's how it looks for one channel in the filter dialog: | ||
As well as showing the effect on the slope, I've also included a grayscale version of Mona, with the right-hand side showing the result of applying this change to all the color channels: | As well as showing the effect on the slope, I've also included a grayscale version of Mona, with the right-hand side showing the result of applying this change to all the color channels: | ||
Ligne 11: | Ligne 17: | ||
By changing the intercept you can alter the contrast of the image; you may also want to tweak the slope to ensure you don't also change the brightness at the same time (unless that's your intention). For example, setting an intercept of 0.5 with a slope of 1 would give you this result: | By changing the intercept you can alter the contrast of the image; you may also want to tweak the slope to ensure you don't also change the brightness at the same time (unless that's your intention). For example, setting an intercept of 0.5 with a slope of 1 would give you this result: | ||
- | Bear in mind that color channels can't go below 0 or above 127, so the graph changes shape when you hit these limits. As you can see, it becomes horizontal halfway along the x-axis, washing out any values above 127 by turning them completely white. Compensating for this by changing the slope to 0.5 preserves the detail a lot more, because all 255 input values are mapped, rather than just clamping half of them. | + | Bear in mind that color channels can't go below 0 or above 127, so the graph changes shape when you hit these limits. As you can see, it becomes horizontal halfway along the x-axis, washing out any values above 127 by turning them completely white. Compensating for this by changing the slope to 0.5 preserves the detail a lot more, because all 255 input values are mapped, rather than just clamping half of them.** |
- | The intercept value can also be negative, to give a darker output, again with reduced contrast. It's worth noting that the slope can also be negative, which inverts the mapping so that larger input values are converted to small output values, and vice versa. With a slope of -1 and an intercept of 1, the output from the channel is completely inverted: | + | Les mathématiques de base nous disent qu'une ligne droite comme celle-ci peut être définie par sa pente et le point où elle coupe l'axe des y. Une façon de modifier la conversion est donc de modifier la pente et le point d' |
+ | |||
+ | Tout en montrant l' | ||
+ | |||
+ | Le changement de la pente pour une valeur plus petite, 0,5 dans ce cas, réduit la luminosité de l' | ||
+ | |||
+ | En changeant l' | ||
+ | |||
+ | Gardez en tête que les canaux de couleurs ne peuvent pas passer sous 0 ou au-dessus de 127 ; aussi, le graphique change de forme quand vous atteignez ces limites. Comme vous pouvez le voir, il devient horizontal à mi-chemin sur l'axe des x, délavant toutes les valeurs au-dessus de 127 en les rendant complètement blanches. Compenser ceci par une modification de la pente à 0,5 préserve beaucoup plus de détails, car les 255 valeurs sont toutes converties, au lieu d'en brider la moitié. | ||
+ | |||
+ | **The intercept value can also be negative, to give a darker output, again with reduced contrast. It's worth noting that the slope can also be negative, which inverts the mapping so that larger input values are converted to small output values, and vice versa. With a slope of -1 and an intercept of 1, the output from the channel is completely inverted: | ||
The linear mode of this filter primitive assumes that you want a simple mapping from input to output, to adjust the brightness or contrast by altering the slope and position of a single line. But there are times when a single straight line (even one that flattens out at the limits of the color range) just doesn' | The linear mode of this filter primitive assumes that you want a simple mapping from input to output, to adjust the brightness or contrast by altering the slope and position of a single line. But there are times when a single straight line (even one that flattens out at the limits of the color range) just doesn' | ||
Ligne 19: | Ligne 35: | ||
“Table” may be a little misleading, as the table you have to supply is one-dimensional. “List” might have been a better name, but table is what the SVG Working Group decided to go with, and what Inkscape exposes. The numbers in the list represent the start and end values for a series of straight line segments; the number of values in the list determines how many segments there are. For example, the table below has five values (you can use spaces and/or commas to separate them): | “Table” may be a little misleading, as the table you have to supply is one-dimensional. “List” might have been a better name, but table is what the SVG Working Group decided to go with, and what Inkscape exposes. The numbers in the list represent the start and end values for a series of straight line segments; the number of values in the list determines how many segments there are. For example, the table below has five values (you can use spaces and/or commas to separate them): | ||
- | These five values give rise to four separate segments in the graph, causing the output values to ramp up and down rapidly as the input varies: | + | These five values give rise to four separate segments in the graph, causing the output values to ramp up and down rapidly as the input varies:** |
- | A table consisting of just (0, 1) would be the same as the identity mapping, whereas (1, 0) would invert the image. To flatten a section of the line, use the same value twice in succession: (1, 0.5, 0.5, 0) gives an inverted image where the details in the low and high values are preserved, but the middle third of numbers are all mapped to 127: | + | La valeur de l' |
+ | |||
+ | Le mode linéaire de la primitive de filtrage considère que vous voulez une simple conversion de l' | ||
+ | |||
+ | « Table » est un peu trompeur, car la table que vous devez fournir est mono-dimensionnelle. « Liste » aurait pu être un meilleur titre, mais table est ce que le groupe de travail SVG a décidé de choisir et ce qu' | ||
+ | |||
+ | Ces cinq valeurs donnent lieu à quatre segments distincts sur le graphique, entraînant une montée et une descente rapides des valeurs de sortie lorsque les valeurs d' | ||
+ | |||
+ | **A table consisting of just (0, 1) would be the same as the identity mapping, whereas (1, 0) would invert the image. To flatten a section of the line, use the same value twice in succession: (1, 0.5, 0.5, 0) gives an inverted image where the details in the low and high values are preserved, but the middle third of numbers are all mapped to 127: | ||
As you can see, the input range is divided evenly based on the number of values in your table, and the line ramps smoothly between them. Sometimes, however, a smooth transition is the last thing you want. Suppose that you have to reduce the number of colors in an image (“posterizing”), | As you can see, the input range is divided evenly based on the number of values in your table, and the line ramps smoothly between them. Sometimes, however, a smooth transition is the last thing you want. Suppose that you have to reduce the number of colors in an image (“posterizing”), | ||
- | With discrete mode you still provide a “table” of values, but rather than defining start and end points that will be interpolated between, you provide a list of the only output values that are allowed, and Inkscape will map them to sections of the input range. Provide only two numbers and any input value of 127 or less will be mapped to the first value, 128 or greater will be mapped to the second value. Instant monochrome! Provide four numbers and values from 0-63 will be mapped to the first, 64-127 to the second, and so on. | + | With discrete mode you still provide a “table” of values, but rather than defining start and end points that will be interpolated between, you provide a list of the only output values that are allowed, and Inkscape will map them to sections of the input range. Provide only two numbers and any input value of 127 or less will be mapped to the first value, 128 or greater will be mapped to the second value. Instant monochrome! Provide four numbers and values from 0-63 will be mapped to the first, 64-127 to the second, and so on.** |
- | Except there' | + | Une table constituée seulement de (0, 1) fera une conversion Identité, alors que (1, 0) inversera l' |
+ | |||
+ | Comme vous pouvez le voir, l' | ||
+ | |||
+ | En mode Discret, vous fournissez encore une « table » de valeurs, mais, plutôt que de définir des points de départ et d' | ||
+ | |||
+ | **Except there' | ||
For the examples below I've pretended that Inkscape works the way it should – just bear in mind that when I say (0, 1) you should actually use (0, 1, 1) to get it to work on the current release. Speaking of which, here is that monochrome output, using a discrete table containing (0, 1): | For the examples below I've pretended that Inkscape works the way it should – just bear in mind that when I say (0, 1) you should actually use (0, 1, 1) to get it to work on the current release. Speaking of which, here is that monochrome output, using a discrete table containing (0, 1): | ||
- | This one uses values of (1, 0.75, 0.5, 0.25, 0) to posterize Mona down to five shades of gray, whilst inverting the output at the same time: | + | This one uses values of (1, 0.75, 0.5, 0.25, 0) to posterize Mona down to five shades of gray, whilst inverting the output at the same time:** |
- | One thing you've undoubtedly noticed about all of the modes so far is that the graphs consist entirely of straight lines – either horizontal ones in the case of Discrete, or angled in the case of Table, Linear and Identity. The last option adds a bit of curvature to the graph, but don't get too excited; it doesn' | + | Sauf qu'il y une erreur dans Inkscape qui l' |
+ | |||
+ | Pour les exemples ci-dessous, j'ai fait comme si Inkscape fonctionnait correctement - gardez simplement en tête que ce que je dis (0, 1) devrait être réellement (0, 1, 1) pour que ça marche dans la version actuelle. A ce propos, voici cette version monochrome, en utilisant une table discrète contenant (0, 1) : | ||
+ | |||
+ | Celle-ci utilise les valeurs (1, 0.75, 0.5, 0.25, 0) pour postériser la Joconde en cinq nuances de gris, tout en inversant la sortie dans le même temps : | ||
+ | |||
+ | **One thing you've undoubtedly noticed about all of the modes so far is that the graphs consist entirely of straight lines – either horizontal ones in the case of Discrete, or angled in the case of Table, Linear and Identity. The last option adds a bit of curvature to the graph, but don't get too excited; it doesn' | ||
In case you're not familiar with gamma correction, it's a non-linear mapping of input to output values, which is used to adjust the brightness and contrast of an image to compensate for differences in perceived brightness at the ends of the range. Think of it as a more sophisticated option than just changing the slope and intercept using the Linear mode, because it allows lower values to change at a different rate than higher values. | In case you're not familiar with gamma correction, it's a non-linear mapping of input to output values, which is used to adjust the brightness and contrast of an image to compensate for differences in perceived brightness at the ends of the range. Think of it as a more sophisticated option than just changing the slope and intercept using the Linear mode, because it allows lower values to change at a different rate than higher values. | ||
Ligne 39: | Ligne 75: | ||
The Gamma mode takes three parameters: Amplitude, Exponent and Offset. The output value from the transfer function is calculated using the following formula: | The Gamma mode takes three parameters: Amplitude, Exponent and Offset. The output value from the transfer function is calculated using the following formula: | ||
- | output = Amplitude × inputExponent + Offset | + | output = Amplitude × inputExponent + Offset** |
- | That is, the input value (which is in the range 0 to 1) is raised to the power of the Exponent value, multiplied by the Amplitude and added to the Offset. Often the Amplitude is left as 1, and the Offset as 0, so the output is simply the input raised to the power of the Exponent. For an Exponent of 2, therefore, the result looks something like this: | + | Une chose que vous aurez probablement déjà constaté pour tous ces modes, c'est que les graphiques sont entièrement constitués de lignes droites, horizontales dans le cas de Discret, anguleuses pour Table, Linéaire et Identité. La dernière option ajoute un peu de courbure au graphique, mais ne vous réjouissez pas trop ; elle ne vous permet pas de dessiner une courbe de Bézier quelconque, mais plutôt d' |
+ | |||
+ | Dans le cas où vous ne seriez pas familier avec la correction du gamma, c'est une conversion non linéaire des valeurs d' | ||
+ | |||
+ | Le mode Gamma utilise trois paramètres : l' | ||
+ | |||
+ | sortie = Amplitude x entréeExposant + Offset | ||
+ | |||
+ | **That is, the input value (which is in the range 0 to 1) is raised to the power of the Exponent value, multiplied by the Amplitude and added to the Offset. Often the Amplitude is left as 1, and the Offset as 0, so the output is simply the input raised to the power of the Exponent. For an Exponent of 2, therefore, the result looks something like this: | ||
To lighten an image simply use an exponent value of less than 1 – such as in this example with a value of 0.5. | To lighten an image simply use an exponent value of less than 1 – such as in this example with a value of 0.5. | ||
Ligne 47: | Ligne 91: | ||
Notice the similarity to the Linear mode with slope values of 0.5 (to darken) and 2 (to lighten). Gamma mode often gives a more detailed result, particularly where there are subtle changes in the darker areas of the input range. | Notice the similarity to the Linear mode with slope values of 0.5 (to darken) and 2 (to lighten). Gamma mode often gives a more detailed result, particularly where there are subtle changes in the darker areas of the input range. | ||
- | Although I've used a grayscale image to illustrate this filter, in practice you can use a different transfer function for each color component, and also for the alpha channel – useful for leaving the alpha channel untouched in Identity mode whilst you alter the color channels, or alternatively for only affecting the alpha channel whilst the colors remain untouched. | + | Although I've used a grayscale image to illustrate this filter, in practice you can use a different transfer function for each color component, and also for the alpha channel – useful for leaving the alpha channel untouched in Identity mode whilst you alter the color channels, or alternatively for only affecting the alpha channel whilst the colors remain untouched.** |
- | To finish, therefore, here's a final image of Mona in all her colorful glory, with four different component transfers applied. The top left quarter has a Table (1, 0) applied to just the green channel, with the others left as Identity; the top right uses Table (0, 1, 0, 1, 0) on all the color channels; the bottom right uses Discrete (0, 0.25, 0.5, 0.75, 1) on the color channels to posterize the image, and the bottom left uses Table (1, 0) on all the channels to produce a “photographic negative” effect. | + | C' |
+ | |||
+ | Pour éclaircir une image, utilisez simplement une valeur d' | ||
+ | |||
+ | Notez la similarité avec le mode Linéaire, avec les pentes à 0,5 (pour foncer) et 2 (pour éclaircir). Le mode Gamma offre souvent un résultat plus détaillé, particulièrement s'il y a des modifications subtiles dans les parties sombres de la plage d' | ||
+ | |||
+ | Bien que j'aie utilisé une image en niveaux de gris pour illustrer ce filtre, vous pouvez en pratique utiliser une fonction de transfert différente pour chaque composante de couleur, ainsi que pour le canal alpha, utile pour conserver intact le canal alpha dans le mode Identité alors que vous modifiez les canaux de couleurs, ou, au contraire, pour n' | ||
+ | |||
+ | **To finish, therefore, here's a final image of Mona in all her colorful glory, with four different component transfers applied. The top left quarter has a Table (1, 0) applied to just the green channel, with the others left as Identity; the top right uses Table (0, 1, 0, 1, 0) on all the color channels; the bottom right uses Discrete (0, 0.25, 0.5, 0.75, 1) on the color channels to posterize the image, and the bottom left uses Table (1, 0) on all the channels to produce a “photographic negative” effect. | ||
Image Credits | Image Credits | ||
“La Gioconda” (aka “Mona Lisa”) by Leonardo da Vinci | “La Gioconda” (aka “Mona Lisa”) by Leonardo da Vinci | ||
- | http:// | + | http:// |
+ | |||
+ | Donc, pour finir, voici une image de la Joconde dans toute sa gloire colorée, avec l' | ||
+ | |||
+ | Crédits image : | ||
+ | La Joconde (aka Mona Lisa) par Leonardo da Vinci | ||
+ | https:// |
issue116/inkscape.1483368167.txt.gz · Dernière modification : 2017/01/02 15:42 de auntiee