Grayscale

Grayscale
Color depth

1-bit monochrome
8-bit grayscale
8-bit color
15/16-bit color (High color)
24-bit color (True color)
30/36/48-bit color (Deep color)

Related

Indexed color
Palette
RGB color model
Web-safe color

This box: view · talk · edit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

In photography and computing, a grayscale or greyscale digital image is an image in which the value of each pixel is a single sample, that is, it carries only intensity information. Images of this sort, also known as black-and-white, are composed exclusively of shades of gray, varying from black at the weakest intensity to white at the strongest.[1]

In simple words it is "black and white" and shades of grey with no other colours.

Grayscale images are distinct from one-bit bi-tonal black-and-white images, which in the context of computer imaging are images with only the two colors, black, and white (also called bilevel or binary images). Grayscale images have many shades of gray in between. Grayscale images are also called monochromatic, denoting the presence of only one (mono) color (chrome).

Grayscale images are often the result of measuring the intensity of light at each pixel in a single band of the electromagnetic spectrum (e.g. infrared, visible light, ultraviolet, etc.), and in such cases they are monochromatic proper when only a given frequency is captured. But also they can be synthesized from a full color image; see the section about converting to grayscale.

Contents

Numerical representations

A typical grayscale image.

The intensity of a pixel is expressed within a given range between a minimum and a maximum, inclusive. This range is represented in an abstract way as a range from 0 (total absence, black) and 1 (total presence, white), with any fractional values in between. This notation is used in academic papers, but it must be noted that this does not define what "black" or "white" is in terms of colorimetry.

Another convention is to employ percentages, so the scale is then from 0% to 100%. This is used for a more intuitive approach, but if only integer values are used, the range encompasses a total of only 101 intensities, which are insufficient to represent a broad gradient of grays. Also, the percentile notation is used in printing to denote how much ink is employed in halftoning, but then the scale is reversed, being 0% the paper white (no ink) and 100% a solid black (full ink).

In computing, although the grayscale can be computed through rational numbers, image pixels are stored in binary, quantized form. Some early grayscale monitors can only show up to sixteen (4-bit) different shades, but today grayscale images (as photographs) intended for visual display (both on screen and printed) are commonly stored with 8 bits per sampled pixel, which allows 256 different intensities (i.e., shades of gray) to be recorded, typically on a non-linear scale. The precision provided by this format is barely sufficient to avoid visible banding artifacts, but very convenient for programming due to the fact that a single pixel then occupies a single byte.

Technical uses (e.g. in medical imaging or remote sensing applications) often require more levels, to make full use of the sensor accuracy (typically 10 or 12 bits per sample) and to guard against roundoff errors in computations. Sixteen bits per sample (65,536 levels) is a convenient choice for such uses, as computers manage 16-bit words efficiently. The TIFF and the PNG (among other) image file formats supports 16-bit grayscale natively, although browsers and many imaging programs tend to ignore the low order 8 bits of each pixel.

No matter what pixel depth is used, the binary representations assume that 0 is black and the maximum value (255 at 8 bpp, 65,535 at 16 bpp, etc.) is white, if not otherwise noted.

Converting color to grayscale

Conversion of a color image to grayscale is not unique; different weighting of the color channels effectively represent the effect of shooting black-and-white film with different-colored photographic filters on the cameras. A common strategy is to match the luminance of the grayscale image to the luminance of the color image.

To convert any color to a grayscale representation of its luminance, first one must obtain the values of its red, green, and blue (RGB) primaries in linear intensity encoding, by gamma expansion. Then, add together 30% of the red value, 59% of the green value, and 11% of the blue value[2][3][4] (these weights depend on the exact choice of the RGB primaries, but are typical). Regardless of the scale employed (0.0 to 1.0, 0 to 255, 0% to 100%, etc.), the resultant number is the desired linear luminance value; it typically needs to be gamma compressed to get back to a conventional grayscale representation.

This is not the method used to obtain the luma in the Y'UV and related color models, used in standard color TV and video systems as PAL and NTSC, as well as in the L*a*b color model. These systems directly compute a gamma-compressed luma as a linear combination of gamma-compressed primary intensities, rather than use linearization via gamma expansion and compression.

To convert a gray intensity value to RGB, simply set all the three primary color components red, green and blue to the gray value, correcting to a different gamma if necessary.

Grayscale as single channels of multichannel color images

Color images are often built of several stacked color channels, each of them representing value levels of the given channel. For example, RGB images are composed of three independent channels for red, green and blue primary color components; CMYK images have four channels for cyan, magenta, yellow and black ink plates, etc.

Here is an example of color channel splitting of a full RGB color image. The column at left shows the isolated color channels in natural colors, while at right there are their grayscale equivalences:

RGB channels separation.png

The reverse is also possible: to build a full color image from their separate grayscale channels. By mangling channels, using offsets, rotating and other manipulations, artistic effects can be achieved instead of accurately reproducing the original image.

See also

References

  1. ^ Stephen Johnson (2006). Stephen Johnson on Digital Photography. O'Reilly. ISBN 059652370X. http://books.google.com/books?id=0UVRXzF91gcC&pg=PA17&dq=grayscale+black-and-white-continuous-tone&ei=XlwqSdGVOILmkwTalPiIDw. 
  2. ^ "Conversion to Greyscale". http://gimp-savvy.com/BOOK/node54.html. 
  3. ^ William K. Pratt (1991). Digital Image Processing. New York: John Wiley & Sons. 
  4. ^ This formula is also used in the GNU Image Manipulation Program GIMP

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • grayscale — UK [ˈɡreɪˌskeɪl] US noun [countable/uncountable] [singular grayscale plural grayscales] computing the American spelling of greyscale …   Useful english dictionary

  • grayscale — UK [ˈɡreɪˌskeɪl] / US noun [countable/uncountable] Word forms grayscale : singular grayscale plural grayscales computing the American spelling of greyscale …   English dictionary

  • grayscale — 1. noun A printed strip of graduated tones used to check exposure and development times. 2. adjective (imaging) black and white, representing color with shades of gray. Syn: black and white …   Wiktionary

  • grayscale — pilkumo tonas statusas T sritis informatika apibrėžtis Tam tikras pilkumo laipsnis. Gaunamas reikiama proporcija sumaišius baltų ir juodų dažų. Iliustraciją žr. priede. priedas( ai) Grafinis formatas atitikmenys: angl. grayscale; greyscale …   Enciklopedinis kompiuterijos žodynas

  • grayscale — adjective see gray scale …   New Collegiate Dictionary

  • Grayscale — …   Википедия

  • grayscale — n. series of graduated tones ranging from black to white (also greyscale) …   English contemporary dictionary

  • grayscale — noun US spelling of greyscale …   English new terms dictionary

  • grayscale monitor — monitor which can only display shades of gray …   English contemporary dictionary

  • grayscale scanner — device which converts pictures on paper into graphic information in shades of grey …   English contemporary dictionary

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”