HOME

TheInfoList



OR:

sRGB is a standard RGB (red, green, blue) color space that HP and
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
created cooperatively in 1996 to use on monitors, printers, and the
World Wide Web The World Wide Web (WWW), commonly known as the Web, is an information system enabling documents and other web resources to be accessed over the Internet. Documents and downloadable media are made available to the network through web se ...
. It was subsequently standardized by the
International Electrotechnical Commission The International Electrotechnical Commission (IEC; in French: ''Commission électrotechnique internationale'') is an international standards organization that prepares and publishes international standards for all electrical, electronic and ...
(IEC) as IEC 61966-2-1:1999. sRGB is the current defined standard
colorspace A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represen ...
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. sRGB essentially codifies the display specifications for the computer monitors in use at that time, which greatly aided its acceptance. sRGB uses the same color primaries and white point as ITU-R BT.709 standard for
HDTV High-definition television (HD or HDTV) describes a television system which provides a substantially higher image resolution than the previous generation of technologies. The term has been used since 1936; in more recent times, it refers to the g ...
, a
transfer function In engineering, a transfer function (also known as system function or network function) of a system, sub-system, or component is a mathematical function that theoretically models the system's output for each possible input. They are widely used ...
(or
gamma Gamma (uppercase , lowercase ; ''gámma'') is the third letter of the Greek alphabet. In the system of Greek numerals it has a value of 3. In Ancient Greek, the letter gamma represented a voiced velar stop . In Modern Greek, this letter r ...
) compatible with the era's CRT displays, and a viewing environment designed to match typical home and office viewing conditions. An amendment of the IEC 61966-2-1 standard document that defines sRGB includes the definition of a number of variants including sYCC, which is a Y′Cb′Cr′ luma-chroma-chroma color representation of sRGB colors with an extended range of values in the RGB domain (supporting negative values in the RGB domain).


sRGB definition


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 In color reproduction, including computer graphics and photography, the gamut, or color gamut , is a certain ''complete subset'' of colors. The most common usage refers to the subset of colors which can be accurately represented in a given circ ...
of chromaticities that can be represented in sRGB is the
color triangle A color triangle is an arrangement of colors within a triangle, based on the additive combination of three primary colors at its corners. An additive color space defined by three primary colors has a chromaticity gamut that is a color ...
defined by these primaries. As with any
RGB color space An RGB color space is any additive color space based on the RGB color model. An RGB color space is defined by chromaticity coordinates of the red, green, and blue additive primaries, the white point which is usually a standard illuminant, and ...
, for non-negative 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 with normal trichromatic vision. 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 display A flat-panel display (FPD) is an electronic display used to display visual content such as text or images. It is present in consumer, medical, transportation, and industrial equipment. Flat-panel displays are thin, lightweight, provide better l ...
s at the time were generally designed to emulate CRT characteristics, the values also reflected prevailing practice for other display devices as well.


Transfer function ("gamma")

The IEC specification indicates a reference display with a nominal
gamma Gamma (uppercase , lowercase ; ''gámma'') is the third letter of the Greek alphabet. In the system of Greek numerals it has a value of 3. In Ancient Greek, the letter gamma represented a voiced velar stop . In Modern Greek, this letter r ...
of 2.2, intended to be similar to the gamma response of CRT displays. The ability to directly display sRGB images on a CRT without any lookup greatly helped sRGB's adoption. Gamma also conveniently places more numbers near the black, reducing visible quantization artifacts. The standard further defines a nonlinear
electro-optical transfer function This article is about the transfer functions used in pictures and videos and describing the relationship between electrical signal, scene light and displayed light. Definition The opto-electronic transfer function (OETF) is the transfer funct ...
(EOTF), which exactly defines the relationship between the output intensity of the primaries and the image data as stored. This curve is a slight tweaking of the simple Gamma 2.2 function. A linear section is near zero, in order to avoid an infinite or zero slope that a gamma curve has. This is spliced to a curved section designed so the overall function is very close to a gamma 2.2 function. In order to do this a formula using a higher exponent (2.4 in this case) is necessary. The ''instantaneous'' gamma (the slope when plotted on a log:log scale) varies from 1 in the linear section to 2.4 at maximum intensity, with a median value being close to 2.2. In practice a pure gamma curve may be used with sRGB data with very little difference, this is referred to as "simple sRGB" by Adobe, and also what happens when it is displayed unchanged on a CRT.


Computing the transfer function

A straight line that passes through is y = \frac, and a gamma curve that passes through is y = \left(\frac\right)^\Gamma If these are joined at the point then: :\frac = \left(\frac\right)^\Gamma If the slopes match at this point, then the derivatives must also be equal: :\frac = \Gamma\left(\frac\right)^\left(\frac\right) We now have two equations. If we take the two unknowns to be and then we can solve to give :X = \frac, \Phi=\frac The values and were chosen so the curve closely resembled the gamma-2.2 curve. This gives . These values, rounded to sometimes describe sRGB conversion. Draft publications by sRGB's creators further rounded , resulting in a small discontinuity in the curve. Some authors adopted these incorrect values, in part because the draft paper was freely available and the official IEC standard is behind a paywall. For the standard, the rounded value of was kept and was recomputed as to make the curve continuous, resulting in a slope discontinuity from below the intersection to above.


Viewing environment

The sRGB specification assumes a dimly lit encoding (creation) environment with an ambient correlated color temperature (CCT) of 5003 K. 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. 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.


Transformation


From sRGB to CIE XYZ

The sRGB component values R_\mathrm, G_\mathrm, B_\mathrm are in the range 0 to 1. When represented digitally as 8-bit numbers, these color component values are in the range of 0 to 255, and should be divided (in a floating point representation) by 255 to convert to the range of 0 to 1. :C_\mathrm= \begin\dfrac, & C_\mathrm\le0.04045 \\ mu\left(\dfrac\right)^, & C_\mathrm>0.04045 \end where C is R, G, or B. These gamma-expanded values (sometimes called "linear values" or "linear-light values") are multiplied by a matrix to obtain CIE XYZ (the matrix has infinite precision, any change in its values or adding not zeroes is not allowed): : \begin X_ \\ Y_ \\ Z_ \end = \begin 0.4124 & 0.3576 & 0.1805 \\ 0.2126 & 0.7152 & 0.0722 \\ 0.0193 & 0.1192 & 0.9505 \end \begin R_\text \\ G_\text \\ B_\text \end This is actually the matrix for BT.709 primaries, not just for sRGB, the second row corresponds to the BT.709-2 luma coefficients (BT.709-1 had a typo in these coefficients).


From CIE XYZ to sRGB

The CIE XYZ 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 The CIELAB color space, also referred to as ''L*a*b*'' , is a color space defined by the International Commission on Illumination (abbreviated CIE) in 1976. (Referring to CIELAB as "Lab" without asterisks should be avoided to prevent confusion ...
, when using specified white points). The first step in the calculation of sRGB from CIE XYZ is a linear transformation, which may be carried out by a matrix multiplication. (The numerical values below match those in the official sRGB specification, which corrected small rounding errors in the original publication by sRGB's creators, and assume the 2°
standard colorimetric observer The CIE 1931 color spaces are the first defined quantitative links between distributions of wavelengths in the electromagnetic visible spectrum, and physiologically perceived colors in human color vision. The mathematical relationships that defi ...
for CIE XYZ.) This matrix depends on the bitdepth. : \begin R_\text \\ G_\text \\ B_\text \end = \begin +3.2406 & -1.5372 & -0.4986 \\ -0.9689 & +1.8758 & +0.0415 \\ +0.0557 & -0.2040 & +1.0570 \end \begin X_ \\ Y_ \\ Z_ \end These linear RGB values are ''not'' the final result; gamma correction must still be applied. The following formula transforms the linear values into sRGB: :C_\text = \begin 12.92C_\text, & C_\text \le 0.0031308 \\ mu1.055C_\text^-0.055, & C_\text > 0.0031308 \end where C is R, G, or B. These gamma-compressed values (sometimes called "non-linear values") are usually clipped to the 0 to 1 range. This clipping can be done before or after the gamma calculation, or done as part of converting to 8 bits. If values in the range 0 to 255 are required, e.g. for video display or 8-bit graphics, the usual technique is to multiply by 255 and round to an integer.


Usage

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 is being labeled as sRGB, one can't conclude that the image is color-accurate sRGB. If the color space of an image is unknown and it is an 8 bit image format, sRGB is usually the assumed default, in part because color spaces with a larger gamut need a higher bit depth to maintain a low color error rate (∆E). An
ICC profile In color management, an ICC profile is a set of data that characterizes a color input or output device, or a color space, according to standards promulgated by the International Color Consortium (ICC). Profiles describe the color attributes of ...
or a look up table may be used to convert sRGB to other color spaces. ICC profiles for sRGB are widely distributed, and the ICC distributes several variants of sRGB profiles,sRGB profiles
ICC
including variants for 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. Version 2 of the ICC profile specification does not officially support piecewise parametric curve encoding ("para"), though version 2 does support simple gamma curves. Nevertheless, lookup tables are more commonly used as they are computationally more efficient. Even when parametric curves are used, software will often reduce to a run-time lookup table for efficient processing. As the sRGB gamut meets or exceeds the gamut of a low-end
inkjet printer Inkjet printing is a type of computer printing that recreates a digital image by propelling droplets of ink onto paper and plastic substrates. Inkjet printers were the most commonly used type of printer in 2008, and range from small inexpens ...
, an sRGB image is often regarded as satisfactory for home printing. sRGB 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 The CMYK color model (also known as process color, or four color) is a subtractive color model, based on the CMY color model, used in color printing, and is also used to describe the printing process itself. The abbreviation ''CMYK'' refers ...
printing. Images intended for professional printing via a fully color-managed workflow (e.g.
prepress Prepress is the term used in the Printing and Publishing industries for the processes and procedures that occur between the creation of a print layout and the final printing. The prepress process includes the preparation of artwork for press, media ...
output) sometimes use another color space such as Adobe RGB (1998), which accommodates a wider gamut. Such images used on the Internet may be converted to sRGB using
color management In digital imaging systems, color management (or colour management) is the controlled conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, computer print ...
tools that are usually included with software that works in these other color spaces. The two dominant programming interfaces for 3D graphics,
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
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, added to the core in OpenGL 2.1) and rendering into sRGB gamma encoded
framebuffer A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Modern ...
s (first introduced with EXT_framebuffer_sRGB extension, 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
GPU A graphics processing unit (GPU) is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systems, mo ...
s (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.


sYCC

Amendment 1 to IEC 61966-2-1:1999, approved in 2003, includes the definition of a Y′Cb′Cr′ color representation called sYCC, which is based on sRGB except for supporting negative values of the R, G and B components and thus allowing for an extended-gamut. 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 instead of BT.709. The amendment describes how to apply the gamma correction to negative values, by applying when is negative (and is the sRGB↔linear functions described above), as part of the Y′Cb′Cr′ definition. This is also used by scRGB. The amendment also recommends a higher-precision XYZ to sRGB matrix using seven decimal points, to more accurately invert the sRGB to XYZ matrix (which remains at the precision shown above): : \begin R_\text \\ G_\text \\ B_\text \end = \begin +3.2406255 & -1.5372080 & -0.4986286 \\ -0.9689307 & +1.8757561 & +0.0415175 \\ +0.0557101 & -0.2040211 & +1.0569959 \end \begin X_ \\ Y_ \\ Z_ \end . Additionally, the amendment contains an extended-gamut encoding for sRGB called bg-sRGB and a YCC transformation for it called bg-sYCC.


References


Standards

* IEC 61966-2-1:1999 is the official specification of sRGB. It provides viewing environment, encoding, and
colorimetric 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 colo ...
details.
Amendment A1:2003
to IEC 61966-2-1:1999 describes an sYCC encoding for
YCbCr 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 video and digital photography systems. Y′ is the luma component and CB and CR are the blue-dif ...
color spaces, an extended-
gamut In color reproduction, including computer graphics and photography, the gamut, or color gamut , is a certain ''complete subset'' of colors. The most common usage refers to the subset of colors which can be accurately represented in a given circ ...
RGB encoding, and a
CIELAB The CIELAB color space, also referred to as ''L*a*b*'' , is a color space defined by the International Commission on Illumination (abbreviated CIE) in 1976. (Referring to CIELAB as "Lab" without asterisks should be avoided to prevent confusion ...
transformation.
sRGB
International Color Consortium * The fourth working draft of IEC 61966-2-1 is available online, but is not the complete standard. It can be downloaded fro
www2.units.it

Archive copy of sRGB.com
now unavailable, containing much information on the design, principles, and use of sRGB


External links


International Color Consortium

A Standard Default Color Space for the Internet – sRGB
the early, obsolete draft of the standard at w3.org
Conversion matrices for RGB vs. XYZ conversion


{{Color space 1996 introductions Color space Film and video technology