Grayscale
Encyclopedia
In photography
Photography
Photography is the art, science and practice of creating durable images by recording light or other electromagnetic radiation, either electronically by means of an image sensor or chemically by means of a light-sensitive material such as photographic film...

 and computing
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...

, a grayscale or greyscale digital image
Digital image
A digital image is a numeric representation of a two-dimensional image. Depending on whether or not the image resolution is fixed, it may be of vector or raster type...

 is an image in which the value of each pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

 is a single sample, that is, it carries only intensity
Luminous intensity
In photometry, luminous intensity is a measure of the wavelength-weighted power emitted by a light source in a particular direction per unit solid angle, based on the luminosity function, a standardized model of the sensitivity of the human eye...

 information. Images of this sort, also known as black-and-white
Black-and-white
Black-and-white, often abbreviated B/W or B&W, is a term referring to a number of monochrome forms in visual arts.Black-and-white as a description is also something of a misnomer, for in addition to black and white, most of these media included varying shades of gray...

, are composed exclusively of shades of gray, varying from black at the weakest intensity to white at the strongest.

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
Black-and-white
Black-and-white, often abbreviated B/W or B&W, is a term referring to a number of monochrome forms in visual arts.Black-and-white as a description is also something of a misnomer, for in addition to black and white, most of these media included varying shades of gray...

 images, which in the context of computer imaging are images with only the two color
Color
Color or colour is the visual perceptual property corresponding in humans to the categories called red, green, blue and others. Color derives from the spectrum of light interacting in the eye with the spectral sensitivities of the light receptors...

s, black
Black
Black is the color of objects that do not emit or reflect light in any part of the visible spectrum; they absorb all such frequencies of light...

, and white
White
White is a color, the perception of which is evoked by light that stimulates all three types of color sensitive cone cells in the human eye in nearly equal amounts and with high brightness compared to the surroundings. A white visual stimulation will be void of hue and grayness.White light can be...

 (also called bilevel or binary image
Binary image
A binary image is a digital image that has only two possible values for each pixel. Typically the two colors used for a binary image are black and white though any two colors can be used. The color used for the object in the image is the foreground color while the rest of the image is the...

s
). 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
Electromagnetic spectrum
The electromagnetic spectrum is the range of all possible frequencies of electromagnetic radiation. The "electromagnetic spectrum" of an object is the characteristic distribution of electromagnetic radiation emitted or absorbed by that particular object....

 (e.g. infrared
Infrared
Infrared light is electromagnetic radiation with a wavelength longer than that of visible light, measured from the nominal edge of visible red light at 0.74 micrometres , and extending conventionally to 300 µm...

, visible light
Visible spectrum
The visible spectrum is the portion of the electromagnetic spectrum that is visible to the human eye. Electromagnetic radiation in this range of wavelengths is called visible light or simply light. A typical human eye will respond to wavelengths from about 390 to 750 nm. In terms of...

, ultraviolet
Ultraviolet
Ultraviolet light is electromagnetic radiation with a wavelength shorter than that of visible light, but longer than X-rays, in the range 10 nm to 400 nm, and energies from 3 eV to 124 eV...

, etc.), and in such cases they are monochromatic proper when only a given frequency
Frequency
Frequency is the number of occurrences of a repeating event per unit time. It is also referred to as temporal frequency.The period is the duration of one cycle in a repeating event, so the period is the reciprocal of the frequency...

 is captured. But also they can be synthesized from a full color image; see the section about converting to grayscale.

Numerical representations

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
Colorimetry
Colorimetry is "the science and technology used to quantify and describe physically the human color perception."It is similar to spectrophotometry, but is distinguished by its interest in reducing spectra to the physical correlates of color perception, most often the CIE 1931 XYZ color space...

.

Another convention is to employ percentage
Percentage
In mathematics, a percentage is a way of expressing a number as a fraction of 100 . It is often denoted using the percent sign, “%”, or the abbreviation “pct”. For example, 45% is equal to 45/100, or 0.45.Percentages are used to express how large/small one quantity is, relative to another quantity...

s, so the scale is then from 0% to 100%. This is used for a more intuitive approach, but if only integer
Integer
The integers are formed by the natural numbers together with the negatives of the non-zero natural numbers .They are known as Positive and Negative Integers respectively...

 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
Printing
Printing is a process for reproducing text and image, typically with ink on paper using a printing press. It is often carried out as a large-scale industrial process, and is an essential part of publishing and transaction 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
Binary code
A binary code is a way of representing text or computer processor instructions by the use of the binary number system's two-binary digits 0 and 1. This is accomplished by assigning a bit string to each particular symbol or instruction...

, quantized
Quantization (signal processing)
Quantization, in mathematics and digital signal processing, is the process of mapping a large set of input values to a smaller set – such as rounding values to some unit of precision. A device or algorithmic function that performs quantization is called a quantizer. The error introduced by...

 form. Some early grayscale monitors can only show up to sixteen (4-bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

) 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
Gamma correction
Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma, is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or still image systems...

. The precision provided by this format is barely sufficient to avoid visible banding artifacts
Compression artifact
A compression artifact is a noticeable distortion of media caused by the application of lossy data compression....

, but very convenient for programming due to the fact that a single pixel then occupies a single byte
Byte
The byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...

.

Technical uses (e.g. in medical imaging
Medical imaging
Medical imaging is the technique and process used to create images of the human body for clinical purposes or medical science...

 or remote sensing
Remote sensing
Remote sensing is the acquisition of information about an object or phenomenon, without making physical contact with the object. In modern usage, the term generally refers to the use of aerial sensor technologies to detect and classify objects on Earth by means of propagated signals Remote sensing...

 applications) often require more levels, to make full use of the sensor
Sensor
A sensor is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. For example, a mercury-in-glass thermometer converts the measured temperature into expansion and contraction of a liquid which can be read on a calibrated...

 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
Tagged Image File Format
TIFF is a file format for storing images, popular among graphic artists, the publishing industry, and both amateur and professional photographers in general. As of 2009, it is under the control of Adobe Systems...

 and the PNG (among other) image file formats
Image file formats
Image file formats are standardized means of organizing and storing digital images. Image files are composed of either pixels, vector data, or a combination of the two. Whatever the format, the files are rasterized to pixels when displayed on most graphic displays...

 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
Color depth
In computer graphics, color depth or bit depth is the number of bits used to represent the color of a single pixel in a bitmapped image or video frame buffer. This concept is also known as bits per pixel , particularly when specified along with the number of bits used...

 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
Black-and-white
Black-and-white, often abbreviated B/W or B&W, is a term referring to a number of monochrome forms in visual arts.Black-and-white as a description is also something of a misnomer, for in addition to black and white, most of these media included varying shades of gray...

 film with different-colored photographic filter
Photographic filter
In photography and videography, a filter is a camera accessory consisting of an optical filter that can be inserted in the optical path. The filter can be a square or oblong shape mounted in a holder accessory, or, more commonly, a glass or plastic disk with a metal or plastic ring frame, which...

s 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
Gamma correction
Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma, is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or still image systems...

. Then, add together 30% of the red value, 59% of the green value, and 11% of the blue value (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
Gamma correction
Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma, is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or still image systems...

 to get back to a conventional grayscale representation.

This is not the method used to obtain the luma
Luma (video)
In video, luma, sometimes called luminance, represents the brightness in an image . Luma is typically paired with chrominance. Luma represents the achromatic image without any color, while the chroma components represent the color information...

 in the Y'UV and related color models, used in standard color TV and video systems as PAL
PAL
PAL, short for Phase Alternating Line, is an analogue television colour encoding system used in broadcast television systems in many countries. Other common analogue television systems are NTSC and SECAM. This page primarily discusses the PAL colour encoding system...

 and NTSC
NTSC
NTSC, named for the National Television System Committee, is the analog television system that is used in most of North America, most of South America , Burma, South Korea, Taiwan, Japan, the Philippines, and some Pacific island nations and territories .Most countries using the NTSC standard, as...

, as well as in the L*a*b
Lab color space
A Lab color space is a color-opponent space with dimension L for lightness and a and b for the color-opponent dimensions, based on nonlinearly compressed CIE XYZ color space coordinates....

 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 channel
Channel (digital image)
Color digital images are made of pixels, and pixels are made of combinations of primary colors. A channel in this context is the grayscale image of the same size as a color image, made of just one of these primary colors. For instance, an image from a standard digital camera will have a red, green...

s, 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
Primary color
Primary colors are sets of colors that can be combined to make a useful range of colors. For human applications, three primary colors are usually used, since human color vision is trichromatic....

 components; CMYK images have four channels for cyan, magenta, yellow and black ink plates
Color printing
Color printing or Colour printing is the reproduction of an image or text in color...

, 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:



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

  • Black-and-white
    Black-and-white
    Black-and-white, often abbreviated B/W or B&W, is a term referring to a number of monochrome forms in visual arts.Black-and-white as a description is also something of a misnomer, for in addition to black and white, most of these media included varying shades of gray...

  • Channel (digital image)
    Channel (digital image)
    Color digital images are made of pixels, and pixels are made of combinations of primary colors. A channel in this context is the grayscale image of the same size as a color image, made of just one of these primary colors. For instance, an image from a standard digital camera will have a red, green...

  • Binary image
    Binary image
    A binary image is a digital image that has only two possible values for each pixel. Typically the two colors used for a binary image are black and white though any two colors can be used. The color used for the object in the image is the foreground color while the rest of the image is the...

  • Halftone
    Halftone
    Halftone is the reprographic technique that simulates continuous tone imagery through the use of dots, varying either in size, in shape or in spacing...

  • Duotone
    Duotone
    Duotone is a halftone reproduction of an image using the superimposition of one contrasting color halftone over another color halftone. This is most often used to bring out middle tones and highlights of an image...

  • False-color
    False-color
    A false-color image is an image that depicts a subject in colors that differ from those a full-color photograph would show.-True- and false-color:...

  • Sepia tone
  • Cyanotype
    Cyanotype
    Cyanotype is a photographic printing process that gives a cyan-blue print. The process was popular in engineering circles well into the 20th century. The simple and low-cost process enabled them to produce large-scale copies of their work, referred to as blueprints...

  • Morphological image processing
  • List of monochrome and RGB palettes – Monochrome palettes section
  • List of software palettes – Color gradient palettes and false color palettes sections
  • Achromatopsia, total color blindness
    Color blindness
    Color blindness or color vision deficiency is the inability or decreased ability to see color, or perceive color differences, under lighting conditions when color vision is not normally impaired...

    , in which vision is limited to a grayscale.
  • Zone System
    Zone system
    The Zone System is a photographic technique for determining optimal film exposure and development, formulated by Ansel Adams and Fred Archer. Adams described how the Zone System was developed: "I take this opportunity to restate that the Zone System is not an invention of mine; it is a codification...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK