Grayscale
≈ 7 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
In digital photography, computer-generated imagery, and colorimetry, a grayscale (American English) or greyscale (Commonwealth English) image is one in which the value of each pixel holds no color information. Pixel values are typically stored in the range 0 to 255 (black to white). Grayscale images, are black-and-white or gray monochrome - composed exclusively of shades of gray. The contrast ranges from black at the weakest intensity to white at the strongest. Grayscale images are distinct from one-bit bi-tonal black-and-white images, which, in the context of computer imaging, are images with only two colors: black and white (also called bilevel or binary images). Grayscale images have many shades of gray in between. Grayscale images can be the result of measuring the intensity of light at each pixel according to a particular weighted combination of frequencies (or wavelengths), and in such cases they are monochromatic proper when only a single frequency (in practice, a narrow band of frequencies) is captured. The frequencies can in principle be from anywhere in the electromagnetic spectrum (e.g. infrared, visible light, ultraviolet, etc.).…
In digital photography, computer-generated imagery, and colorimetry, a grayscale (American English) or greyscale (Commonwealth English) image is one in which the value of each pixel holds no color information. Pixel values are typically stored in the range 0 to 255 (black to white). Grayscale images, are black-and-white or gray monochrome - composed exclusively of shades of gray. The contrast ranges from black at the weakest intensity to white at the strongest. Grayscale images are distinct from one-bit bi-tonal black-and-white images, which, in the context of computer imaging, are images with only two colors: black and white (also called bilevel or binary images). Grayscale images have many shades of gray in between. Grayscale images can be the result of measuring the intensity of light at each pixel according to a particular weighted combination of frequencies (or wavelengths), and in such cases they are monochromatic proper when only a single frequency (in practice, a narrow band of frequencies) is captured. The frequencies can in principle be from anywhere in the electromagnetic spectrum (e.g. infrared, visible light, ultraviolet, etc.). A colorimetric (or more specifically photometric) grayscale image is an image that has a defined grayscale colorspace, which maps the stored numeric sample values to the achromatic channel of a standard colorspace, which itself is based on measured properties of human vision. If the original color image has no defined colorspace, or if the grayscale image is not intended to have the same human-perceived achromatic intensity as the color image, then there is no unique mapping from such a color image to a grayscale image. C_\mathrm{linear}= \begin{cases}\frac{C_\mathrm{srgb}}{12.92}, & \text{if } C_\mathrm{srgb}\le0.04045\\ \left(\frac{C_\mathrm{srgb}+0.055}{1.055}\right)^{2.4}, & \text{otherwise} \end{cases} where represents any of the three gamma-compressed sRGB primaries ( , , and , each in range [0,1]) and is the corresponding linear-intensity value ( , , and , also in range [0,1]). Then, linear luminance is calculated as a weighted sum of the three linear-intensity values. The sRGB color space is defined in terms of the CIE 1931 linear luminance , which is given by Y_\mathrm{linear} = 0.2126 R_\mathrm{linear} + 0.7152 G_\mathrm{linear} + 0.0722 B_\mathrm{linear}. These three particular coefficients represent the intensity (luminance) perception of typical trichromat humans to light of the precise Rec. 709 additive primary colors (chromaticities) that are used in the definition of sRGB. Human vision is most sensitive to green, so this has the greatest coefficient value (0.7152), and least sensitive to blue, so this has the smallest coefficient (0.0722). To encode grayscale intensity in linear RGB, each of the three color components can be set to equal the calculated linear luminance Y_\mathrm{linear} (replacing R_\mathrm{linear},G_\mathrm{linear},B_\mathrm{linear} by the values Y_\mathrm{linear},Y_\mathrm{linear},Y_\mathrm{linear} to get this linear grayscale), which then typically needs to be gamma compressed to get back to a conventional non-linear representation. For sRGB, each of its three primaries is then set to the same gamma-compressed given by the inverse of the gamma expansion above as Y_\mathrm{srgb}=\begin{cases} 12.92\ Y_\mathrm{linear}, & \text{if } Y_\mathrm{linear} \le 0.0031308\\ 1.055\ Y_\mathrm{linear}^{1/2.4}-0.055, & \text{otherwise} \end{cases} Because the three sRGB components are then equal, indicating that it is actually a gray image (not color), it is only necessary to store these values once, and we call this the resulting grayscale image. This is how it will normally be stored in sRGB-compatible image formats that support a single-channel grayscale representation, such as JPEG or PNG. Web browsers and other software that recognizes sRGB images should produce the same rendering for such a grayscale image as it would for a "color" sRGB image having the same values in all three color channels. Y' = 0.299 R' + 0.587 G' + 0.114 B' where we use the prime to distinguish these nonlinear values from the sRGB nonlinear values (discussed above) which use a somewhat different gamma compression formula, and from the linear RGB components. The ITU-R BT.709 standard used for HDTV developed by the ATSC uses different color coefficients, computing the luma component as Y' = 0.2126 R' + 0.7152 G' + 0.0722 B'. Although these are numerically the same coefficients used in sRGB above, the effect is different because here they are being applied directly to gamma-compressed values rather than to the linearized values. The ITU-R BT.2100 standard for HDR television uses yet different coefficients, computing the luma component as Y' = 0.2627 R' + 0.6780 G' + 0.0593 B'. Normally these colorspaces are transformed back to nonlinear R'G'B' before rendering for viewing. To the extent that enough precision remains, they can then be rendered accurately. But if the luma component Y' itself is instead used directly as a grayscale representation of the color image, luminance is not preserved: two colors can have the same luma but different CIE linear luminance (and thus different nonlinear as defined above) and therefore appear darker or lighter to a typical human than the original color. Similarly, two colors having the same luminance (and thus the same ) will in general have different luma by either of the luma definitions above. ==Examples== File:Asaro Mud Man Kabiufa Papua New Guinea.jpg|photographer: Jialiang Gao - year: 2008 - license: CC BY-SA 3.0
Text derived from https://en.wikipedia.org/w/index.php?oldid=1364248086 under CC BY-SA 4.0; modifications have been made.