| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" |
| 3 |
"http://www.docbook.org/xml/4.3/docbookx.dtd"> |
| 4 |
<!-- section history: |
| 5 |
2017-03-26 elle stone: update desaturate help and add new images |
| 6 |
2017-01-29 desaturate moved to Colors/Desaturate, changed id to plug-in-desaturate |
| 7 |
--> |
| 8 |
<sect2 xmlns:xi="http://www.w3.org/2001/XInclude" id="gimp-filter-desaturate"> |
| 9 |
<title>Desaturate</title> |
| 10 |
<indexterm> |
| 11 |
<primary>Colors</primary> |
| 12 |
<secondary>Desaturate</secondary> |
| 13 |
<tertiary>Desaturate</tertiary> |
| 14 |
</indexterm> |
| 15 |
<indexterm> |
| 16 |
<primary>Desaturate</primary> |
| 17 |
</indexterm> |
| 18 |
<para> |
| 19 |
By using the <guimenuitem>Desaturate</guimenuitem> command, you can convert |
| 20 |
all of the colors on the active layer to corresponding shades of gray. This |
| 21 |
differs from converting the image to grayscale in two respects. First, it |
| 22 |
only operates on the active layer and second, the colors on the layer are |
| 23 |
still RGB values with three components, with R=G=B, which makes gray. |
| 24 |
This means that you then can paint on the layer, or individual parts of it, |
| 25 |
using non-gray colors. |
| 26 |
</para> |
| 27 |
|
| 28 |
<note> |
| 29 |
<para> |
| 30 |
This command only works on layers of |
| 31 |
<link linkend="glossary-rgb">RGB</link> images. If the image is in |
| 32 |
Grayscale or Indexed mode, it can do nothing. |
| 33 |
</para> |
| 34 |
</note> |
| 35 |
|
| 36 |
<sect3> |
| 37 |
<title>Activating the Command</title> |
| 38 |
<para> |
| 39 |
You can access this command from the main menu through |
| 40 |
<menuchoice> |
| 41 |
<guimenu>Colors</guimenu> |
| 42 |
<guisubmenu>Desaturate</guisubmenu> |
| 43 |
<guimenuitem>Desaturate…</guimenuitem> |
| 44 |
</menuchoice>. |
| 45 |
</para> |
| 46 |
</sect3> |
| 47 |
|
| 48 |
<sect3> |
| 49 |
<title>Options</title> |
| 50 |
<figure> |
| 51 |
<title>The <quote>Desaturate</quote> option dialog</title> |
| 52 |
<mediaobject> |
| 53 |
<imageobject> |
| 54 |
<imagedata fileref="images/menus/colors/desaturate/desaturate.png" |
| 55 |
format="PNG"/> |
| 56 |
</imageobject> |
| 57 |
</mediaobject> |
| 58 |
</figure> |
| 59 |
<para><guilabel>Mode:</guilabel> Five options are available for converting |
| 60 |
from color to black and white:</para> |
| 61 |
<variablelist> |
| 62 |
<varlistentry> |
| 63 |
<term>Presets</term> |
| 64 |
<term>Blending Options</term> |
| 65 |
<term>Preview</term> |
| 66 |
<term>Merge filter</term> |
| 67 |
<term>Split view</term> |
| 68 |
<listitem> |
| 69 |
<xi:include href="../about-common-features.xml"/> |
| 70 |
</listitem> |
| 71 |
</varlistentry> |
| 72 |
<varlistentry> |
| 73 |
<term><link linkend="More-information-about-Luminance">Luminance</link> |
| 74 |
</term> |
| 75 |
<listitem> |
| 76 |
<para>The shades of gray will be calculated using |
| 77 |
<ulink url="http://brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html"> |
| 78 |
linearized sRGB</ulink> as |
| 79 |
</para> |
| 80 |
<informalequation> |
| 81 |
<mediaobject> |
| 82 |
<textobject> |
| 83 |
<phrase> |
| 84 |
Luminance = |
| 85 |
(0.22 × R) + |
| 86 |
(0.72 × G) + |
| 87 |
(0.06 × B) |
| 88 |
</phrase> |
| 89 |
</textobject> |
| 90 |
</mediaobject> |
| 91 |
</informalequation> |
| 92 |
</listitem> |
| 93 |
</varlistentry> |
| 94 |
<varlistentry> |
| 95 |
<term><link linkend="More-information-about-Luma">Luma</link></term> |
| 96 |
<listitem> |
| 97 |
<para>The shades of gray will be calculated using non-linearized sRGB |
| 98 |
</para> |
| 99 |
<informalequation> |
| 100 |
<mediaobject> |
| 101 |
<textobject> |
| 102 |
<phrase> |
| 103 |
Luma = (0.22 × R) + (0.72 × G) + (0.06 × B) |
| 104 |
</phrase> |
| 105 |
</textobject> |
| 106 |
</mediaobject> |
| 107 |
</informalequation> |
| 108 |
</listitem> |
| 109 |
</varlistentry> |
| 110 |
<varlistentry> |
| 111 |
<term> |
| 112 |
<link linkend="More-information-about-Lightness-Average-and-Value"> |
| 113 |
Lightness (HSL)</link></term> |
| 114 |
<listitem> |
| 115 |
<para>The shades of gray will be calculated as</para> |
| 116 |
<informalequation> |
| 117 |
<mediaobject> |
| 118 |
<textobject> |
| 119 |
<phrase> |
| 120 |
Lightness (HSL) = ½ × (max(R,G,B) + min(R,G,B)) |
| 121 |
</phrase> |
| 122 |
</textobject> |
| 123 |
</mediaobject> |
| 124 |
</informalequation> |
| 125 |
</listitem> |
| 126 |
</varlistentry> |
| 127 |
<varlistentry> |
| 128 |
<term> |
| 129 |
<link linkend="More-information-about-Lightness-Average-and-Value"> |
| 130 |
Average (HSI Intensity)</link></term> |
| 131 |
<listitem> |
| 132 |
<para>The shades of gray will be calculated as</para> |
| 133 |
<informalequation> |
| 134 |
<mediaobject> |
| 135 |
<textobject> |
| 136 |
<phrase>Average (HSI Intensity) = (R + G + B) ÷ 3 |
| 137 |
</phrase> |
| 138 |
</textobject> |
| 139 |
</mediaobject> |
| 140 |
</informalequation> |
| 141 |
</listitem> |
| 142 |
</varlistentry> |
| 143 |
<varlistentry> |
| 144 |
<term> |
| 145 |
<link linkend="More-information-about-Lightness-Average-and-Value"> |
| 146 |
Value (HSV)</link></term> |
| 147 |
<listitem> |
| 148 |
<para>The shades of gray will be calculated as</para> |
| 149 |
<informalequation> |
| 150 |
<mediaobject> |
| 151 |
<textobject> |
| 152 |
<phrase> |
| 153 |
Value (HSV) = max(R,G,B) |
| 154 |
</phrase> |
| 155 |
</textobject> |
| 156 |
</mediaobject> |
| 157 |
</informalequation> |
| 158 |
</listitem> |
| 159 |
</varlistentry> |
| 160 |
</variablelist> |
| 161 |
|
| 162 |
<figure> |
| 163 |
<title>Using the five modes to convert two very different color images |
| 164 |
to black and white</title> |
| 165 |
<mediaobject> |
| 166 |
<imageobject> |
| 167 |
<imagedata format="PNG" |
| 168 |
fileref="images/menus/colors/desaturate/colors-desaturate-original-sunflower.png"/> |
| 169 |
</imageobject> |
| 170 |
<caption> |
| 171 |
<para>Original image</para> |
| 172 |
</caption> |
| 173 |
</mediaobject> |
| 174 |
<mediaobject> |
| 175 |
<imageobject> |
| 176 |
<imagedata format="PNG" |
| 177 |
fileref="images/menus/colors/desaturate/colors-desaturate-original-red-globe.png"/> |
| 178 |
</imageobject> |
| 179 |
<caption> |
| 180 |
<para>Original image</para> |
| 181 |
</caption> |
| 182 |
</mediaobject> |
| 183 |
<mediaobject> |
| 184 |
<imageobject> |
| 185 |
<imagedata format="PNG" |
| 186 |
fileref="images/menus/colors/desaturate/colors-desaturate-luminance-sunflower.png"/> |
| 187 |
</imageobject> |
| 188 |
<caption> |
| 189 |
<para><quote>Luminance</quote> applied</para> |
| 190 |
</caption> |
| 191 |
</mediaobject> |
| 192 |
<mediaobject> |
| 193 |
<imageobject> |
| 194 |
<imagedata format="PNG" |
| 195 |
fileref="images/menus/colors/desaturate/colors-desaturate-luminance-red-globe.png"/> |
| 196 |
</imageobject> |
| 197 |
<caption> |
| 198 |
<para><quote>Luminance</quote> applied</para> |
| 199 |
</caption> |
| 200 |
</mediaobject> |
| 201 |
<mediaobject> |
| 202 |
<imageobject> |
| 203 |
<imagedata format="PNG" |
| 204 |
fileref="images/menus/colors/desaturate/colors-desaturate-luma-sunflower.png"/> |
| 205 |
</imageobject> |
| 206 |
<caption> |
| 207 |
<para> |
| 208 |
<quote>Luma</quote> applied. |
| 209 |
</para> |
| 210 |
</caption> |
| 211 |
</mediaobject> |
| 212 |
<mediaobject> |
| 213 |
<imageobject> |
| 214 |
<imagedata format="PNG" |
| 215 |
fileref="images/menus/colors/desaturate/colors-desaturate-luma-red-globe.png"/> |
| 216 |
</imageobject> |
| 217 |
<caption> |
| 218 |
<para> |
| 219 |
<quote>Luma</quote> applied. |
| 220 |
</para> |
| 221 |
</caption> |
| 222 |
</mediaobject> |
| 223 |
<mediaobject> |
| 224 |
<imageobject> |
| 225 |
<imagedata format="PNG" |
| 226 |
fileref="images/menus/colors/desaturate/colors-desaturate-lightness-sunflower.png"/> |
| 227 |
</imageobject> |
| 228 |
<caption> |
| 229 |
<para> |
| 230 |
<quote>Lightness (HSL)</quote> applied. |
| 231 |
</para> |
| 232 |
</caption> |
| 233 |
</mediaobject> |
| 234 |
<mediaobject> |
| 235 |
<imageobject> |
| 236 |
<imagedata format="PNG" |
| 237 |
fileref="images/menus/colors/desaturate/colors-desaturate-lightness-red-globe.png"/> |
| 238 |
</imageobject> |
| 239 |
<caption> |
| 240 |
<para> |
| 241 |
<quote>Lightness (HSL)</quote> applied. |
| 242 |
</para> |
| 243 |
</caption> |
| 244 |
</mediaobject> |
| 245 |
<mediaobject> |
| 246 |
<imageobject> |
| 247 |
<imagedata format="PNG" |
| 248 |
fileref="images/menus/colors/desaturate/colors-desaturate-average-sunflower.png"/> |
| 249 |
</imageobject> |
| 250 |
<caption> |
| 251 |
<para> |
| 252 |
<quote>Average (HSI Intensity)</quote> applied. |
| 253 |
</para> |
| 254 |
</caption> |
| 255 |
</mediaobject> |
| 256 |
<mediaobject> |
| 257 |
<imageobject> |
| 258 |
<imagedata format="PNG" |
| 259 |
fileref="images/menus/colors/desaturate/colors-desaturate-average-red-globe.png"/> |
| 260 |
</imageobject> |
| 261 |
<caption> |
| 262 |
<para> |
| 263 |
<quote>Average (HSI Intensity)</quote> applied. |
| 264 |
</para> |
| 265 |
</caption> |
| 266 |
</mediaobject> |
| 267 |
<mediaobject> |
| 268 |
<imageobject> |
| 269 |
<imagedata format="PNG" |
| 270 |
fileref="images/menus/colors/desaturate/colors-desaturate-value-sunflower.png"/> |
| 271 |
</imageobject> |
| 272 |
<caption> |
| 273 |
<para> |
| 274 |
<quote>Value (HSV)</quote> applied. |
| 275 |
</para> |
| 276 |
</caption> |
| 277 |
</mediaobject> |
| 278 |
<mediaobject> |
| 279 |
<imageobject> |
| 280 |
<imagedata format="PNG" |
| 281 |
fileref="images/menus/colors/desaturate/colors-desaturate-value-red-globe.png"/> |
| 282 |
</imageobject> |
| 283 |
<caption> |
| 284 |
<para> |
| 285 |
<quote>Value (HSV)</quote> applied. |
| 286 |
</para> |
| 287 |
</caption> |
| 288 |
</mediaobject> |
| 289 |
</figure> |
| 290 |
</sect3> |
| 291 |
|
| 292 |
<sect3> |
| 293 |
<title>Comparing results from using different options for |
| 294 |
converting from color to black and white:</title> |
| 295 |
<orderedlist> |
| 296 |
<listitem> |
| 297 |
<para> |
| 298 |
The degree and direction from which the various ways to convert |
| 299 |
an image to black and white diverge from a straight Luminance conversion |
| 300 |
to black and white depends on: |
| 301 |
</para> |
| 302 |
<itemizedlist> |
| 303 |
<listitem> |
| 304 |
<para> |
| 305 |
The conversion method you choose. |
| 306 |
</para> |
| 307 |
</listitem> |
| 308 |
<listitem> |
| 309 |
<para> |
| 310 |
The RGB color space in which the conversion is done. |
| 311 |
</para> |
| 312 |
</listitem> |
| 313 |
<listitem> |
| 314 |
<para> |
| 315 |
How saturated the colors in the original image happen to |
| 316 |
be, with more saturated starting colors (such as the red globe and the |
| 317 |
bright yellow sunflower) producing greater amounts of deviation from a |
| 318 |
straight Luminance conversion. |
| 319 |
</para> |
| 320 |
</listitem> |
| 321 |
<listitem> |
| 322 |
<para> |
| 323 |
The hues (for example yellows vs reds) of the various |
| 324 |
saturated colors in an image also make a difference. |
| 325 |
</para> |
| 326 |
</listitem> |
| 327 |
<listitem> |
| 328 |
<para> |
| 329 |
Being the maximum of the RGB channel values for each |
| 330 |
pixel, an HSV Value conversion to black and white is always lighter than |
| 331 |
the original color image, and also lighter than all the other ways to |
| 332 |
convert to black and white. |
| 333 |
</para> |
| 334 |
</listitem> |
| 335 |
</itemizedlist> |
| 336 |
</listitem> |
| 337 |
<listitem> |
| 338 |
<para> |
| 339 |
Comparing the red globe to the yellow sunflower: |
| 340 |
</para> |
| 341 |
<itemizedlist> |
| 342 |
<listitem> |
| 343 |
<para> |
| 344 |
For the red globe Lightness (HSL) produces a result very |
| 345 |
similar to Luminance, and Luma produces a conversion that is much darker. |
| 346 |
</para> |
| 347 |
</listitem> |
| 348 |
<listitem> |
| 349 |
<para> |
| 350 |
For the sunflower, Luma produces a result very similar to |
| 351 |
Luminance, and Lightness (HSL) produces a conversion that is much darker. |
| 352 |
</para> |
| 353 |
</listitem> |
| 354 |
<listitem> |
| 355 |
<para> |
| 356 |
Notice that the less saturated parts of each image look |
| 357 |
more or less the same, regardless of which method is chosen for converting |
| 358 |
from color to black and white. |
| 359 |
</para> |
| 360 |
</listitem> |
| 361 |
</itemizedlist> |
| 362 |
</listitem> |
| 363 |
</orderedlist> |
| 364 |
</sect3> |
| 365 |
|
| 366 |
<sect3> |
| 367 |
<title>More information about the five options for |
| 368 |
converting from color to black and white:</title> |
| 369 |
<orderedlist> |
| 370 |
<listitem id="More-information-about-Luminance"> |
| 371 |
<para><emphasis>More information about Luminance:</emphasis></para> |
| 372 |
<itemizedlist> |
| 373 |
<listitem> |
| 374 |
<para> |
| 375 |
"Luminance" is the only physically meaningful way to |
| 376 |
convert a color image to black and white, as the resulting black and |
| 377 |
white image has the same relative luminance (reflects the same |
| 378 |
percentage of light from the various shades of gray) as the colors in |
| 379 |
the original color image. |
| 380 |
</para> |
| 381 |
</listitem> |
| 382 |
<listitem> |
| 383 |
<para> |
| 384 |
Luminance must be calculated using linearized RGB values. |
| 385 |
</para> |
| 386 |
</listitem> |
| 387 |
<listitem> |
| 388 |
<para> |
| 389 |
For convenience we say "Luminance", but what we really |
| 390 |
mean is "Relative Luminance". For more information, see |
| 391 |
<ulink url="https://en.wikipedia.org/wiki/Relative_luminance">Relative |
| 392 |
Luminance</ulink> and |
| 393 |
<ulink url="https://en.wikipedia.org/wiki/CIE_1931_color_space#Meaning_of_X,_Y_and_Z"> |
| 394 |
CIE 1931 [XYZ] color space</ulink>. |
| 395 |
</para> |
| 396 |
</listitem> |
| 397 |
<listitem> |
| 398 |
<para> |
| 399 |
GIMP uses hard-coded sRGB values to do Luminance |
| 400 |
conversions to black and white. "Future GIMP" will support correct |
| 401 |
conversions for images in other color spaces. |
| 402 |
</para> |
| 403 |
</listitem> |
| 404 |
</itemizedlist> |
| 405 |
</listitem> |
| 406 |
<listitem id="More-information-about-Luma"> |
| 407 |
<para> |
| 408 |
<emphasis>More information about Luma:</emphasis> |
| 409 |
</para> |
| 410 |
<itemizedlist> |
| 411 |
<listitem> |
| 412 |
<para> |
| 413 |
"Luma" is what you get if you use the formula for |
| 414 |
Luminance on RGB values that haven't been properly linearized. |
| 415 |
</para> |
| 416 |
</listitem> |
| 417 |
<listitem> |
| 418 |
<para> |
| 419 |
The multipliers have been properly Bradford-adapted to |
| 420 |
D50, which is required for use in an ICC profile color-managed editing |
| 421 |
application (at least until the next version of the ICC specs is |
| 422 |
released and people figure out how to deal with the new freedom to use |
| 423 |
non-D50 reference white points). |
| 424 |
</para> |
| 425 |
</listitem> |
| 426 |
<listitem> |
| 427 |
<para> |
| 428 |
<acronym>GIMP</acronym> uses hard-coded sRGB values to do Luma |
| 429 |
conversions to black and white. "Future GIMP" will support correct |
| 430 |
conversions for images in other color spaces. |
| 431 |
</para> |
| 432 |
</listitem> |
| 433 |
</itemizedlist> |
| 434 |
</listitem> |
| 435 |
<listitem id="More-information-about-Lightness-Average-and-Value"> |
| 436 |
<para> |
| 437 |
<emphasis>More information about Lightness, Average, and Value: |
| 438 |
</emphasis> |
| 439 |
</para> |
| 440 |
<para> |
| 441 |
The "Lightness (HSL)", "Average (HSI Intensity)", and "Value (HSV)" |
| 442 |
ways to convert a color image to black and white use color space models |
| 443 |
that were invented for fast processing on consumer-grade computers from the |
| 444 |
1990s. For details see |
| 445 |
<ulink url="https://en.wikipedia.org/wiki/HSL_and_HSV">HSL and HSV</ulink>, |
| 446 |
paying particular attention to the section on |
| 447 |
<ulink url="https://en.wikipedia.org/wiki/HSL_and_HSV#Disadvantages">Disadvantages</ulink>. |
| 448 |
</para> |
| 449 |
</listitem> |
| 450 |
<listitem> |
| 451 |
<para> |
| 452 |
<emphasis>In case you are wondering why LAB Lightness</emphasis> is |
| 453 |
not among the options |
| 454 |
for converting an RGB image to black and white, a properly calculated |
| 455 |
conversion from RGB to LAB Lightness, and then back to RGB, produces exactly |
| 456 |
the same result as the Luminance conversion to black and white. Here is why: |
| 457 |
</para> |
| 458 |
<itemizedlist> |
| 459 |
<listitem> |
| 460 |
<para> |
| 461 |
In the XYZ color space, Y is Luminance. So if you |
| 462 |
convert a color RGB image to XYZ, the "Y" of XYZ is the same number as |
| 463 |
the R=G=B values that you get when you calculate RGB Luminance. |
| 464 |
</para> |
| 465 |
</listitem> |
| 466 |
<listitem> |
| 467 |
<para> |
| 468 |
LAB is a perceptually uniform transform of XYZ. If you |
| 469 |
convert from RGB to XYZ and then to LAB, and set A=B=0.0 (or 0.5 for |
| 470 |
image editors that put the midpoint of the A and B axes as 0.5 instead |
| 471 |
of at 0.0), and then convert back to XYZ, the X and Z values will |
| 472 |
change, but Y will not change. |
| 473 |
</para> |
| 474 |
</listitem> |
| 475 |
</itemizedlist> |
| 476 |
<para> |
| 477 |
Tutorials that produce anything other than Relative Luminance when |
| 478 |
converting an RGB image to black and white using LAB Lightness, very sadly |
| 479 |
are trading on various mathematical mistakes in the conversion routines. |
| 480 |
</para> |
| 481 |
</listitem> |
| 482 |
</orderedlist> |
| 483 |
</sect3> |
| 484 |
|
| 485 |
</sect2> |