sRGB is a standard RGB color space created cooperatively by HP and Microsoft in 1996 for use on monitors, printers and the Internet.
sRGB uses the ITUR BT.709 primaries, the same as are used in studio monitors and HDTV,^{[1]} and a transfer function (gamma curve) typical of CRTs. This specification allowed sRGB to be directly displayed on typical CRT monitors of the time, a factor which greatly aided its acceptance.
Unlike most other RGB color spaces, the sRGB gamma cannot be expressed as a single numerical value. The overall gamma is approximately 2.2, consisting of a linear (gamma 1.0) section near black, and a nonlinear section elsewhere involving a 2.4 exponent and a gamma (slope of log output versus log input) changing from 1.0 through about 2.3.
Background
The sRGB color space has been endorsed by the W3C, Exif, Intel, Pantone, Corel, and many other industry players. It is used in proprietary and open graphics file formats, such as SVG.
The sRGB color space is well specified and is designed to match typical home and office viewing conditions, rather than the darker environment typically used for commercial color matching.
Much software is now designed with the assumption that an 8bitperchannel image file placed unchanged onto an 8bitperchannel display will appear much as the sRGB specification recommends. LCDs, digital cameras, printers, and scanners all follow the sRGB standard. Devices which do not naturally follow sRGB (like older CRT monitors did) include compensating circuitry or software so that, in the end, they also obey this standard. For this reason, one can generally assume, in the absence of embedded profiles or any other information, that any 8bitperchannel image file or any 8bitperchannel image API or device interface can be treated as being in the sRGB color space. However, when the correct displaying of an RGB color space is needed, color management usually must be employed.
The sRGB gamut
sRGB 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. As with any RGB color space, for nonnegative values of R, G, and B it is not possible to represent colors outside this triangle, which is well inside the range of colors visible to a human.
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.7153

0.0721

1.0000

sRGB also defines a nonlinear transformation between the intensity of these primaries and the actual number stored. The curve is similar to the gamma response of a CRT display. It is more important to replicate this curve than the primaries to get correct display of an sRGB image. This nonlinear conversion means that sRGB is a reasonably efficient use of the values in an integerbased image file to display humandiscernible light levels.
sRGB is sometimes avoided by highend print publishing professionals because its color gamut is not big enough, especially in the bluegreen colors, to include all the colors that can be reproduced in CMYK printing.
Specification of the transformation
The forward transformation (CIE xyY or CIE XYZ to sRGB)
The first step in the calculation of sRGB tristimulus values from the CIE XYZ tristimulus values is a linear transformation, which may be carried out by a matrix multiplication. The numerical values below match those in the official sRGB specification (IEC 6196621:1999) and differ slightly from those in a publication by sRGB's creators.^{[2]} Note that these linear values are not the final result.
 $$
\begin{bmatrix}
R_\mathrm{linear}\\G_\mathrm{linear}\\B_\mathrm{linear}\end{bmatrix}=
\begin{bmatrix}
3.2406&1.5372&0.4986\\
0.9689&1.8758&0.0415\\
0.0557&0.2040&1.0570
\end{bmatrix}
\begin{bmatrix}
X \\
Y \\
Z \end{bmatrix}
Note also, that if the CIE xyY color space values are given (where x, y are the chromaticity coordinates and Y is the luminance), they must first be transformed to CIE XYZ tristimulus values by:
 $X\; =\; Y\; x\; /\; y,\backslash ,$
 $Z\; =\; Y\; (1\; x\; \; y)/y\backslash ,$
The intermediate parameters $R\_\backslash mathrm\{linear\}$, $G\_\backslash mathrm\{linear\}$ and $B\_\backslash mathrm\{linear\}$ for ingamut colors are defined to be in the range [0,1], which means that the initial X, Y, and Z values need to be similarly scaled (if you start with XYZ values going to 100 or so, divide them by 100 first, or apply the matrix and then scale by a constant factor to the [0,1] range). The linear RGB values are usually clipped to that range, with display white represented as (1,1,1); the corresponding original XYZ values are such that white is D65 with unit luminance (X,Y,Z = 0.9505, 1.0000, 1.0890). Calculations assume the 2° standard colorimetric observer.^{[2]}
sRGB was designed to reflect a typical realworld monitor with a gamma of 2.2, and the following formula transforms the linear values into sRGB. Let $C\_\backslash mathrm\{linear\}$ be $R\_\backslash mathrm\{linear\}$, $G\_\backslash mathrm\{linear\}$, or $B\_\backslash mathrm\{linear\}$, and $C\_\backslash mathrm\{srgb\}$ be $R\_\backslash mathrm\{srgb\}$, $G\_\backslash mathrm\{srgb\}$ or $B\_\backslash mathrm\{srgb\}$:
 $C\_\backslash mathrm\{srgb\}=\backslash begin\{cases\}$
12.92C_\mathrm{linear}, & C_\mathrm{linear} \le 0.0031308\\
(1+a)C_\mathrm{linear}^{1/2.4}a, & C_\mathrm{linear} > 0.0031308
\end{cases}
These gammacorrected values are in the range 0 to 1. If values in the range 0 to 255 are required, e.g. for video display or 8bit graphics, the usual technique is to multiply by 255 and round to an integer.
The reverse transformation
Again the sRGB component values $R\_\backslash mathrm\{srgb\}$, $G\_\backslash mathrm\{srgb\}$, $B\_\backslash mathrm\{srgb\}$ are in the range 0 to 1. (A range of 0 to 255 can simply be divided by 255).
 $C\_\backslash mathrm\{linear\}=$
\begin{cases}\frac{C_\mathrm{srgb}}{12.92}, & C_\mathrm{srgb}\le0.04045\\
\left(\frac{C_\mathrm{srgb}+a}{1+a}\right)^{2.4}, & C_\mathrm{srgb}>0.04045
\end{cases}
(where $C$ is $R$, $G$, or $B$). Followed by a matrix multiplication of the linear values to get XYZ:
 $$
\begin{bmatrix}
X\\Y\\Z\end{bmatrix}=
\begin{bmatrix}
0.4124&0.3576&0.1805\\
0.2126&0.7152&0.0722\\
0.0193&0.1192&0.9505
\end{bmatrix}
\begin{bmatrix}
R_\mathrm{linear}\\
G_\mathrm{linear}\\
B_\mathrm{linear}\end{bmatrix}
Theory of the transformation
It is often casually stated that the decoding gamma for sRGB data is 2.2, yet the above transform shows an exponent of 2.4. This is because the net effect of the piecewise decomposition is necessarily a changing instantaneous gamma at each point in the range: it goes from gamma = 1 at zero to a gamma of 2.4 at maximum intensity with a median value being close to 2.2. The transformation was designed to approximate a gamma of about 2.2, but with a linear portion near zero to avoid having an infinite slope at K = 0, which can cause numerical problems. The continuity condition for the curve $C\_\backslash mathrm\{linear\}$ which is defined above as a piecewise function of $C\_\backslash mathrm\{srgb\}$, is
 $\backslash left(\backslash frac\{K\_0+a\}\{1+a\}\backslash right)^\backslash gamma=\backslash frac\{K\_0\}\{\backslash phi\}.$
Solving with $\backslash gamma\; =\; 2.4$ and the standard value $\backslash phi=12.92$ yields two solutions, $K\_0$ ≈ $0.0381548$ or $K\_0$ ≈ $0.0404482$. The IEC 6196621 standard uses the rounded value $K\_0=0.04045$. However, if we impose the condition that the slopes match as well then we must have
 $\backslash gamma\backslash left(\backslash frac\{K\_0+a\}\{1+a\}\backslash right)^\{\backslash gamma1\}\backslash left(\backslash frac\{1\}\{1+a\}\backslash right)=\backslash frac\{1\}\{\backslash phi\}.$
We now have two equations. If we take the two unknowns to be $K\_0$ and $\backslash phi$ then we can solve to give
 $K\_0=\backslash frac\{a\}\{\backslash gamma1\},\backslash \; \backslash \; \backslash \; \backslash phi=\backslash frac\{(1+a)^\backslash gamma(\backslash gamma1)^\{\backslash gamma1\}\}\{(a^\{\backslash gamma1\})(\backslash gamma^\backslash gamma)\}.$
Substituting $a=0.055$ and $\backslash gamma=2.4$ gives $K\_0$ ≈ $0.0392857$ and $\backslash phi$ ≈ $12.9232102$, with the corresponding lineardomain threshold at $K\_0\; /\; \backslash phi$ ≈ $0.00303993$. These values, rounded to $K\_0=0.03928$, $\backslash phi=12.92321$, and $K\_0/\backslash phi=0.00304$, are sometimes used to describe sRGB conversion.^{[3]} Publications by sRGB's creators^{[2]} rounded to $K\_0=0.03928$ and $\backslash phi=12.92$, resulting in a small discontinuity in the curve. Some authors adopted these values in spite of the discontinuity.^{[4]} For the standard, the rounded value $\backslash phi=12.92$ was kept and the $K\_0$ value was recomputed to make the resulting curve continuous, as described above, resulting in a slope discontinuity from 12.92 below the intersection to 12.70 above.
Viewing environment
Parameter

Value

Luminance level

80 cd/m^{2}

Illuminant white point

x = 0.3127, y = 0.3291 (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 sRGB specification assumes a dimly lit encoding (creation) environment with an ambient correlated color temperature (CCT) of 5000 K. It is interesting to note that this differs from the CCT of the illuminant (D65). Using D50 for both would have made the white point of most photographic paper appear excessively blue.^{[5]} 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 lessstringent typical viewing environment.^{[2]}
Usage
Due to the standardization of sRGB on the Internet, on computers, and on printers, many low to mediumend consumer digital cameras and scanners use sRGB as the default (or only available) working color space. As the sRGB gamut meets or exceeds the gamut of a lowend inkjet printer, an sRGB image is often regarded as satisfactory for home use. However, consumerlevel CCDs are typically uncalibrated, meaning that even though the image is being labeled as sRGB, one can't conclude that the image is coloraccurate sRGB.
If the color space of an image is unknown and it is an 8 to 16bit image format, assuming it is in the sRGB color space is a safe choice. This allows a program to identify a color space for all images, which may be much easier and more reliable than trying to track the "unknown" color space. An ICC profile may be used; the ICC distributes three such profiles:^{[6]} a profile conforming to version 4 of the ICC specification, which they recommend, and two profiles conforming to version 2, which is still commonly used.
Images intended for professional printing via a fully colormanaged workflow, e.g. prepress output, sometimes use another color space such as Adobe RGB (1998), which allows for a wider gamut. If such images are to be used on the Internet they 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 half part support for the sRGB color space by using sRGB's gamma curve.
OpenGL supports the
See also
References
Standards
 IEC 6196621:1999 is the official specification of sRGB. It provides viewing environment, encoding, and colorimetric details.
 Amendment A1:2003 to IEC 6196621:1999 describes an analogous sYCC encoding for YCbCr color spaces, an extendedgamut RGB encoding, and a CIELAB transformation.
 sRGB on www.color.org
 The fourth working draft of IEC 6196621 is available online, but is not the complete standard. It can be downloaded from www2.units.it.
External links
 International Color Consortium
 Archive copy of http://www.srgb.com, now unavailable, containing much information on the design, principles and use of sRGB
 w3.org
 sgi.com
 Conversion matrices for RGB vs. XYZ conversion
 Will the Real sRGB Profile Please Stand Up?
This article was sourced from Creative Commons AttributionShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, EGovernment Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a nonprofit organization.