IEC 61966-2-1 Default RGB Colour Space - sRGB | |
Abbreviation | sRGB |
---|---|
Status | Published |
Year started | 1996 |
First published | October 18, 1999 [1] |
Organization | IEC [1] |
Committee | TC/SC: TC 100/TA 2 [1] |
Base standards | IEC 61966 Colour Measurement and Management in Multimedia Systems and Equipment |
Domain | Color space, color model |
Website | webstore |
sRGB is a standard numerical encoding of colors, based on the RGB (red, green, blue) color space, for use on monitors, printers, and the World Wide Web. It was initially proposed by HP and Microsoft in 1996 [2] and became an official standard of the International Electrotechnical Commission (IEC) as IEC 61966-2-1:1999. [1] It is the current defined standard colorspace for the web, and it is usually the assumed colorspace for images that are neither tagged for a colorspace nor have an embedded color profile.
The sRGB standard uses the same color primaries and white point as the ITU-R BT.709 standard for HDTV, [3] but a different transfer function (or gamma) compatible with the era's CRT displays, [4] and assumes a viewing environment closer to typical home and office viewing conditions.
The sRGB color space is also the basis of the sYCC color encoding, which is a remapping of the R, G, and B components of sRGB to a luminance (brightness) value and two chroma channels similar to those of the CIE YCbCr encoding. [5]
Chromaticity | Red | Green | Blue | White point |
---|---|---|---|---|
x | 0.6400 | 0.3000 | 0.1500 | 0.3127 |
y | 0.3300 | 0.6000 | 0.0600 | 0.3290 |
Y | 0.2126 | 0.7152 | 0.0722 | 1.0000 |
The sRGB standard defines the chromaticities of the red, green, and blue primaries, the colors where one of the three channels is nonzero and the other two are zero. The gamut of chromaticities that can be represented in sRGB is the color triangle defined by these primaries, which are set such that the range of colors inside the triangle is well within the range of colors visible to a human with normal trichromatic vision. As with any RGB color space, for non-negative values of R, G, and B it is not possible to represent colors outside this triangle.
The primaries come from HDTV (ITU-R BT.709), which are somewhat different from those for older color TV systems (ITU-R BT.601). These values were chosen to reflect the approximate color of consumer CRT phosphors at the time of its design. Since flat-panel displays at the time were generally designed to emulate CRT characteristics, the values also reflected prevailing practice for other display devices as well. [1]
The sRGB standard specifies a non-linear encoding of physical brightness values (proportional to luminous power emitted per unit of area) into the integer R, G, and B values that are to be stored in computer memory or image files. This transfer function commonly called gamma encoding, is the combination of a linear function at low brightness values and a displaced power law for the rest of the range.
Specifically, let be the encoded R, G, or B value, assumed to be an integer ranging from 0 (meaning no light) to some maximum (meaning the maximum displayable intensity of that channel). Typically is 255 when as an 8-bit integer, or generally for an -bit integer. The physical intensity represented by is defined as , where the decoding function is defined as [5]
where , , , and . The result is 0 for no light, and 1 for the maximum intensity. The value is sometimes called the "linear value" or "linear-light value" corresponding to the encoded sample .
Conversely, given a value between 0 and 1 that is proportional to the physical R, G, or B intensity to be displayed, the encoded integer intensity will be , where encoding function is defined as [5]
where , and , , and are the same as in the decoding function .
These sRGB encoding and decoding functions and above are similar in form to those of BT.709, but the values are noticeably different. [4] Because of the rounding of the parameters, they have small discontinuities at the transition between the linear and non-linear part, on the order of 10−8 — which are too small to matter in most practical situations. [6]
For medium and large values of the argument , the decoding function is actually quite close to a pure power law with exponent (gamma) of 2.2. However, for low values (around and below the breakpoint ) the difference is perceptible. [4] [7]
If needed, the encoding and decoding functions , can be used for arguments greater than 1. They are also extended to negative values by the identities , . [5]
In practice, there is still debate and confusion about the formulas used for encoding and decoding image colors from or into "sRGB" files. [8] Also, programmers may choose use the "pure" power law instead of the correct piecewise formulas above, for the sake of code simplicity or efficiency, but that would introduce some issues near black. Also, some operating systems and programs may directly send sRGB encoded images to monitors which actually have a different effective decoding function, such as pure power law with 2.2 exponent, this is further complicated by the standard saying that reference CRT display should use 2.2 gamma. [7]
The sRGB standard specifies also the colors and relative intensities of the three primaries R, G, and B, by defining the mapping between these values (in linear brightness scale, before the gamma encoding) and the CIE XYZ perceptual color coordinates. [9] This mapping is the same specified by the BT.709 standard; in matrix notation, [5]
These coefficients should be considered exact [1] and assume the 2° standard colorimetric observer for CIE XYZ. [2] [10] In particular, the second row of this matrix specifies the computation of the BT.709-2 luma (brightness) value from the linear R, G, and B values. (BT.709-1 had a typo in these coefficients.)
The inverse conversion, from from CIE XYZ to (linear) sRGB, can be obtained by inverting the matrix above to a suitable numerical accuracy. The 1999 standard provides the matrix
which is not the exact inverse of the sRGB to XYZ transformation, but was expected to be accurate enough for 8-bit encoded samples (with ).
The 2003 amended version of the sRGB standard [5] points out that higher accuracy is needed when the samples are encoded with more than 8 bits. It provides the matrix
which is claimed to be sufficiently accurate for samples with bits ().
For these formulas, the X, Y, and Z values must be scaled so that the Y of D65 ("white") is 1.0 (X = 0.9505, Y = 1.0000, Z = 1.0890). This is usually true but some color spaces use 100 or other values (such as in CIELAB, when using specified white points).
The sRGB specification assumes a dimly lit encoding (creation) environment with an ambient correlated color temperature (CCT) of 5003 K:
Parameter | Value |
---|---|
Screen luminance level | 80 cd/m2 |
Illuminant white point | x = 0.3127, y = 0.3290 (D65) |
Image surround reflectance | 20% (~medium gray) |
Encoding ambient illuminance level | 64 lux |
Encoding ambient white point | x = 0.3457, y = 0.3585 (D50) |
Encoding viewing flare | 1.0% |
Typical ambient illuminance level | 200 lux |
Typical ambient white point | x = 0.3457, y = 0.3585 (D50) |
Typical viewing flare | 5.0% |
The assumed ambient CCT differs from that of the BT.709 standard illuminant (D65), which is still retained for the screen white point. Using D50 for both would have made the white point of most photographic paper appear excessively blue. [11] [12] The other parameters, such as the luminance level, are representative of a typical CRT monitor.
For optimal results, the ICC recommends using the encoding viewing environment (i.e., dim, diffuse lighting) rather than the less-stringent typical viewing environment. [13]
Annex G of the 2003 amendment of the sRGB standard describes an alternative encoding of color values, called bg-sRGB, that is recommended when the number of bits per channel is 10 or more.
In this alternative encoding, an integer encoded sample value and the corresponding linear R, G, or B value are related by the formulas
and
where the and functions are the same as in the sRGB space. The standard specifies and for , and generally
for . In the bg-sRGB color space, the null intensity is encoded as the integer , and the maximum displayable intensity is encoded as the integer . This encoding is useful for color space manipulations (like the conversion from sYCC) that can generate values that are negative or greater than 1. [5]
The non-linear encoding of physical data samples is a common digital signal processing technique that aims to make better use of the bits available for the encoded signal, taking into account the non-linear way human senses perceive physical stimuli. Using smaller increments for smaller signals reduces the quantization artifacts.
This principle was incorporated into the digital-to-analog converters and the analog circuitry of early computer monitors, resulting in an effective decoding function (the mapping from digital sample values to the displayed intensity) which was roughly a power law with an exponent between 2 and 3. The exponent was commonly denoted with the letter , hence the common name "gamma correction" (or similar) for this function. This mapping initially varied according to CRT manufacturers, but was normalized in 1993 for use in HDTV systems, as the ITU BT.709 standard [14] The BT.709 standard specified a decoding function with a linear section near zero, transitioning to a shifted power law with exponent 1/0.45 ≈ 2.2222....
The sRGB encoding was created a few years later by Hewlett-Packard and Microsoft. It was meant to describe the decoding function of most CRT computer monitors used with Windows operating systems at the time, which was still different from that assumed by BT.709. [15] The first draft of the standard [2] was published in 1996. A fourth draft, still incomplete, is available online. [16] Like the BT.709, the sRGB decoding function was defined as a linear section near zero that transitions to a shifted power law [17] [18]
In theory, the parameters of the encoding and decoding functions should be chosen so that the transition from the linear section to the power law section is continuous (without a sudden step) and smooth (without a sudden change of slope). [15]
To derive the decoding function, one considers that the general formula for a linear function, whose graph is a straight line that passes through (0,0), is , and a shifted power law curve that passes through (1,1) is
To obtain a seamless transition between the two functions when has a value , we must have
To avoid a sudden change of slope where the two segments meet, the derivatives must be equal at this point:
Solving the two equations for and we get
The first draft of the sRGB standard [2] initially set the parameters at and so that the resulting decoding function closely resembled a pure power law with exponent (gamma) 2.2, assimed to be typical of computer monitors at the time. This choice implies a breakpoint and a linear coefficient . These values, rounded to and are still incorrectly given in some publications. [19] However, the value of was rounded to already in the sRGB draft standard, [2] resulting in a small discontinuity in the curve.
The first official version of the standard was defined and published by the IEC in 1999. In this version, the rounded value of was retained, but the breakpoint was redefined as to make the curve approximately continuous. With these values, there is still a discontinuity in the slope, from just below the intersection to just above it. The final standard also corrected some small rounding errors present in the draft. [2]
The 1999 IEC standard was amended in 2003. [5] The sRGB to CIE XYZ matrix was retained, but the inverse transformation above was replaced by a more accurate version, with seven decimal fraction digits. The amended standard also included the definition of the sYCC encoding, using brightness (Y) and two chroma coordinates (CC) instead of R, G, and B coordinates, and a bg-sRGB encoding for 10-bit components which allows some component values outside the 0-1 range.
Due to the standardization of sRGB on the Internet, on computers, and on printers, many low- to medium-end consumer digital cameras and scanners use sRGB as the default (or only available) working color space. However, consumer-level CCDs are typically uncalibrated, meaning that even though the image or device is being labeled as "sRGB", one cannot assume that the encoded values or the colors of displayed images are accurate as specified by the standard. Recently that changed and smartphones and TVs have very good calibration out of the box.
If the color space of an image is unknown and the R, G, and B samples are encoded with 8 bits each, the sRGB encoding usually the assumed default.
As the sRGB gamut mostly meets or exceeds the gamut of a low-end inkjet printer, an sRGB image is often regarded as satisfactory for home printing. The sRGB color space is sometimes avoided by high-end print publishing professionals because its color gamut is not big enough, especially in the blue-green colors, to include all the colors that can be reproduced in CMYK printing. Images intended for professional printing via a fully color-managed workflow (e.g. prepress output) sometimes use another color space such as Adobe RGB (1998), which accommodates a wider gamut and CMYK color space like Fogra39. Such CMYK and sRGB images used on the Internet may be converted to sRGB using color management tools that are usually included with software that works in these other color spaces.
The two dominant programming interfaces for 3D graphics, OpenGL and Direct3D, have both incorporated support for the sRGB gamma curve. OpenGL supports textures with sRGB gamma encoded color components (first introduced with EXT_texture_sRGB extension, [20] added to the core in OpenGL 2.1) and rendering into sRGB gamma encoded framebuffers (first introduced with EXT_framebuffer_sRGB extension, [21] added to the core in OpenGL 3.0). Correct mipmapping and interpolation of sRGB gamma textures has direct hardware support in texturing units of most modern GPUs (for example nVidia GeForce 8 performs conversion from 8-bit texture to linear values before interpolating those values), and does not have any performance penalty. [22]
A lookup table may be used to efficiently convert sRGB to other color spaces.[ citation needed ] The International Color Consortium (ICC) has published color profiles for this purpose, which are widely used. [13] [10] There are several variants, [23] including ICCmax, version 4, and version 2.
Version 4 is generally recommended, but version 2 is still commonly used and is the most compatible with other software including browsers. [24] However, inconsistencies have been pointed out between those ICC profiles and the IEC sRGB standard. [25] In particular, version 2 of the ICC profile specification does not implement the piecewise parametric curve encoding ("para") as specified by the IEC sRGB standard, [26] and has to implement the linear spline using 1DLUT. [23] What is worse in some cases "simplified sRGB" is used which is just 2.2 gamma. [27]
Amendment 1 to IEC 61966-2-1:1999, approved in 2003, includes the definition of a Y′Cb′Cr′ color representation called sYCC. Although the RGB color primaries are based on BT.709, the equations for transformation from sRGB to sYCC and vice versa are based on BT.601. The sYCC standard specifies 8 bits for the encoded components, and the matrices result in a range of approximately 0–1 for Y; -0.5–0.5 for C. [5]
As this conversion can result in sRGB values outside the range 0–1, the amendment describes how to apply the gamma correction to negative values, by applying −f(−x) when x is negative (and f is the sRGB↔linear functions described above). This is also used by scRGB.
Gamma correction or gamma is a nonlinear operation used to encode and decode luminance or tristimulus values in video or still image systems. Gamma correction is, in the simplest cases, defined by the following power-law expression:
Y′UV, also written YUV, is the color model found in the PAL analogue color TV standard. A color is described as a Y′ component (luma) and two chroma components U and V. The prime symbol (') denotes that the luma is calculated from gamma-corrected RGB input and that it is different from true luminance. Today, the term YUV is commonly used in the computer industry to describe colorspaces that are encoded using YCbCr.
YIQ is the color space used by the analog NTSC color TV system. I stands for in-phase, while Q stands for quadrature, referring to the components used in quadrature amplitude modulation. Other TV systems used different color spaces, such as YUV for PAL or YDbDr for SECAM. Later digital standards use the YCbCr color space. These color spaces are all broadly related, and work based on the principle of adding a color component named chrominance, to a black and white image named luma.
In digital photography, computer-generated imagery, and colorimetry, a greyscale or grayscale image is one in which the value of each pixel is a single sample representing only an amount of light; that is, it carries only intensity information. Grayscale images, are black-and-white or gray monochrome, and composed exclusively of shades of gray. The contrast ranges from black at the weakest intensity to white at the strongest.
YCbCr, Y′CbCr, or Y Pb/Cb Pr/Cr, also written as YCBCR or Y′CBCR, is a family of color spaces used as a part of the color image pipeline in digital video and photography systems.
The Adobe RGB (1998) color space or opRGB is a color space developed by Adobe Inc. in 1998. It was designed to encompass most of the colors achievable on CMYK color printers, but by using RGB primary colors on a device such as a computer display. The Adobe RGB (1998) color space encompasses roughly 30% of the visible colors specified by the CIELAB color space – improving upon the gamut of the sRGB color space, primarily in cyan-green hues. It was subsequently standardized by the IEC as IEC 61966-2-5:1999 with a name opRGB and is used in HDMI.
In 1931 the International Commission on Illumination (CIE) published the CIE 1931 color spaces which define the relationship between the visible spectrum and the visual sensation of specific colors by human color vision. The CIE color spaces are mathematical models that create a "standard observer", which attempts to predict the perception of unique hues of color. These color spaces are essential tools that provide the foundation for measuring color for industry, including inks, dyes, and paints, illumination, color imaging, etc. The CIE color spaces contributed to the development of color television, the creation of instruments for maintaining consistent color in manufacturing processes, and other methods of color management.
LMS, is a color space which represents the response of the three types of cones of the human eye, named for their responsivity (sensitivity) peaks at long, medium, and short wavelengths.
Relative luminance follows the photometric definition of luminance including spectral weighting for human vision, but while luminance is a measure of light in units such as , relative luminance values are normalized as 0.0 to 1.0, with 1.0 being a theoretical perfect reflector of 100% reference white. Like the photometric definition, it is related to the luminous flux density in a particular direction, which is radiant flux density weighted by the luminous efficiency function of the CIE Standard Observer.
xvYCC or extended-gamut YCbCr is a color space that can be used in the video electronics of television sets to support a gamut 1.8 times as large as that of the sRGB color space. xvYCC was proposed by Sony, specified by the IEC in October 2005 and published in January 2006 as IEC 61966-2-4. xvYCC extends the ITU-R BT.709 tone curve by defining over-ranged values. xvYCC-encoded video retains the same color primaries and white point as BT.709, and uses either a BT.601 or BT.709 RGB-to-YCC conversion matrix and encoding. This allows it to travel through existing digital limited range YCC data paths, and any colors within the normal gamut will be compatible. It works by allowing negative RGB inputs and expanding the output chroma. These are used to encode more saturated colors by using a greater part of the RGB values that can be encoded in the YCbCr signal compared with those used in Broadcast Safe Level. The extra-gamut colors can then be displayed by a device whose underlying technology is not limited by the standard primaries.
scRGB is a wide color gamut RGB color space created by Microsoft and HP that uses the same color primaries and white/black points as the sRGB color space but allows coordinates below zero and greater than one. The full range is −0.5 through just less than +7.5.
ITU-R Recommendation 709, usually abbreviated Rec. 709, BT.709, or ITU-R 709, is a standard developed by the Radiocommunication Sector of the International Telecommunication Union (ITU-R) for image encoding and signal characteristics of high-definition television (HDTV). The standard specifies a scheme for digital encoding of colors as triplets of small integers, a widescreen format with 1080 active lines per picture and 1920 square pixels per line, as well as several details of signal capture, transmission, and display. While directed to HDTV, some of its specifications have also been adopted for other uses.
Stokes' theorem, also known as the Kelvin–Stokes theorem after Lord Kelvin and George Stokes, the fundamental theorem for curls, or simply the curl theorem, is a theorem in vector calculus on . Given a vector field, the theorem relates the integral of the curl of the vector field over some surface, to the line integral of the vector field around the boundary of the surface. The classical theorem of Stokes can be stated in one sentence:
There are many ways to derive the Lorentz transformations using a variety of physical principles, ranging from Maxwell's equations to Einstein's postulates of special relativity, and mathematical tools, spanning from elementary algebra and hyperbolic functions, to linear algebra and group theory.
sYCC is a standard numerical encoding of colors, similar to the CIE YCbCr encoding, It uses three coordinates: a luma value , that is roughly proportional to perceived brighness of the color, and two chroma values and , which are roughly the "blueness" and "redness" of the hue. Each coordinate is represented by an integer with some number of bits, which is interpreted as either unsigned or signed.
Standard-dynamic-range video is a video technology which represents light intensity based on the brightness, contrast and color characteristics and limitations of a cathode ray tube (CRT) display. SDR video is able to represent a video or picture's colors with a maximum luminance around 100 cd/m2, a black level around 0.1 cd/m2 and Rec.709 / sRGB color gamut. It uses the gamma curve as its electro-optical transfer function.
ICTCP, ICtCp, or ITP is a color representation format specified in the Rec. ITU-R BT.2100 standard that is used as a part of the color image pipeline in video and digital photography systems for high dynamic range (HDR) and wide color gamut (WCG) imagery. It was developed by Dolby Laboratories from the IPT color space by Ebner and Fairchild. The format is derived from an associated RGB color space by a coordinate transformation that includes two matrix transformations and an intermediate nonlinear transfer function that is informally known as gamma pre-correction. The transformation produces three signals called I, CT, and CP. The ICTCP transformation can be used with RGB signals derived from either the perceptual quantizer (PQ) or hybrid log–gamma (HLG) nonlinearity functions, but is most commonly associated with the PQ function.
ITU-R Recommendation BT.2100, more commonly known by the abbreviations Rec. 2100 or BT.2100, introduced high-dynamic-range television (HDR-TV) by recommending the use of the perceptual quantizer or hybrid log–gamma (HLG) transfer functions instead of the traditional "gamma" previously used for SDR-TV.
Images and videos use specific transfer functions to describe the relationship between electrical signal, scene light and displayed light.
The Oklab color space is a uniform color space for device independent color designed to improve perceptual uniformity, hue and lightness prediction, color blending, and usability while ensuring numerical stability and ease of implementation. Introduced by Björn Ottosson in December 2020, Oklab and its cylindrical counterpart, Oklch, have been included in the CSS Color Level 4 and Level 5 drafts for device-independent web colors since December 2021. They are supported by recent versions of major web browsers and allow the specification of wide-gamut P3 colors.