Difference between revisions of "Convert to grayscale"

From RS Wiki
Jump to: navigation, search
m (Grayscale vs. Color)
(Conversion algorithms)
Line 8: Line 8:
  
 
=Conversion algorithms=
 
=Conversion algorithms=
 +
 +
A grayscale conversion algorithm tries to obtain a black and white image out of a color image. In the process, all pixels are treated equally, no matter their position or spacial significance. The only significant attribute is the color of the pixel. Since most images are taken/stored in Red, Green, Blue the algorithms found in the literature are focused on this representation.
 +
 +
The following methods can be used to convert a color value to black and white:
 +
 +
* '''average''' - simply averages the values: (R + G + B) / 3.
 +
 +
* '''min''' - simply takes the minimum of the values: min(R + G + B).
 +
 +
* '''min''' - simply takes the maximum of the values: max(R + G + B).
 +
 +
* '''luminosity''' - forms a weighted average to account for human perception. The receptors inside the human eye are more sensitive to green than other colors, so green is weighted most heavily. The formula is 0.21 R + 0.71 G + 0.07 B.
 +
 +
* '''lightness''' - averages the most prominent and least prominent colors: (max(R, G, B) + min(R, G, B)) / 2.
 +
 +
* '''RGB channel''' - uses only one of the 3 color channels.
 +
 
=How to convert to grayscale=
 
=How to convert to grayscale=
 
=How to contribute to this article=
 
=How to contribute to this article=

Revision as of 17:44, 14 June 2011

Grayscale vs. Color

A grayscale image is an image that carries only intensity information. such an image, also known as black-and-white, is composed exclusively of shades of gray, varying from black (weakest intensity) to white (strongest intensity).

A photograph is bearing a message to the viewer. This is why black and white photography will always have an extraordinary appeal. Its message is easier to transport, not being disturbed by other color impressions. Think about a wedding dress - doesn't look best in a black and white photo?

Nowadays you almost always shoot in color and convert your images after that to black and white. This is where a good conversion software comes into discussion.

Conversion algorithms

A grayscale conversion algorithm tries to obtain a black and white image out of a color image. In the process, all pixels are treated equally, no matter their position or spacial significance. The only significant attribute is the color of the pixel. Since most images are taken/stored in Red, Green, Blue the algorithms found in the literature are focused on this representation.

The following methods can be used to convert a color value to black and white:

  • average - simply averages the values: (R + G + B) / 3.
  • min - simply takes the minimum of the values: min(R + G + B).
  • min - simply takes the maximum of the values: max(R + G + B).
  • luminosity - forms a weighted average to account for human perception. The receptors inside the human eye are more sensitive to green than other colors, so green is weighted most heavily. The formula is 0.21 R + 0.71 G + 0.07 B.
  • lightness - averages the most prominent and least prominent colors: (max(R, G, B) + min(R, G, B)) / 2.
  • RGB channel - uses only one of the 3 color channels.

How to convert to grayscale

How to contribute to this article

Do you have questions? Use the discussion page of this article to post them.

Do you have improvements? Please feel free to improve the article in any way (from minor spelling issues to restructuring). This is what wiki is for!