SRGB

Last updated
sRGB
IEC 61966-2-1 Default RGB Colour Space - sRGB
SRGB chromaticity CIE1931.svg
sRGB colors situated at calculated position in CIE 1931 chromaticity diagram. Luminance set so that to avoid mach bands.
AbbreviationsRGB
StatusPublished
Year started1996
First publishedOctober 18, 1999;24 years ago (1999-10-18) [1]
Organization IEC [1]
CommitteeTC/SC: TC 100/TA 2 [1]
Base standardsIEC 61966 Colour Measurement and Management in Multimedia Systems and Equipment
Domain Color space, color model
Website webstore.iec.ch/publication/6169

sRGB is a standard RGB (red, green, blue) color space that HP and Microsoft created cooperatively in 1996 to use on monitors, printers, and the World Wide Web. [2] It was subsequently standardized by the International Electrotechnical Commission (IEC) as IEC 61966-2-1:1999. [1] sRGB 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.

Contents

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, [3] a transfer function (or gamma) compatible with the era's CRT displays, and a viewing environment designed to match typical home and office viewing conditions.

sRGB definition

Gamut

Chromaticity RedGreenBlueWhite point
x0.64000.30000.15000.3127
y0.33000.60000.06000.3290
Y0.21260.71520.07221.0000

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

Transfer function ("gamma")

Plot of the sRGB intensities (red), and this function's slope in log-log space (blue), which is the instantaneous gamma. Below a compressed value of 0.04045 or a linear intensity of 0.00313, the curve is linear so the gamma is 1. Behind the red curve is a dashed black curve showing an exact gamma = 2.2 power law. SRGB gamma.svg
Plot of the sRGB intensities (red), and this function's slope in log-log space (blue), which is the instantaneous gamma. Below a compressed value of 0.04045 or a linear intensity of 0.00313, the curve is linear so the gamma is 1. Behind the red curve is a dashed black curve showing an exact gamma = 2.2 power law.
On an sRGB display, each solid bar should look as bright as the surrounding striped dither. (Note: must be viewed at original, 100% size) Srgbnonlinearity.png
On an sRGB display, each solid bar should look as bright as the surrounding striped dither. (Note: must be viewed at original, 100% size)

The IEC specification indicates a reference display with a nominal gamma of 2.2, which the sRGB working group determined was representative of the CRTs used with Windows operating systems at the time. [2] The ability to directly display sRGB images on a CRT without any lookup greatly helped sRGB's adoption[ citation needed ]. Gamma also usefully encodes more data near the black, which reduces visible noise and quantization artifacts.

The standard further defines a opto-electronic transfer function (OETF), which defines the conversion of linear light or signal intensity to a gamma-compressed image data. This curve is approximately the inverse of the display's , but with some adjustments to avoid an infinite slope at zero. [4] Near zero, a power curve intercepts a straight-line section that leads to zero. This prevents the infinite slope at zero that would occur if a plain power curve was used.

In practice a pure may be used with sRGB data with very little difference. This improves computational performance and is referred to as "simple sRGB" by Adobe, This is also how most displays transform the encoded image data to the screen.

Computing the transfer function

A straight line that passes through (0,0) is , and a gamma curve that passes through (1,1) is

If these are joined at the point (X,X/Φ) then:

To avoid a kink where the two segments meet, the derivatives must be equal at this point:

We now have two equations. If we take the two unknowns to be X and Φ then we can solve to give

The values A = 0.055 and Γ = 2.4 were chosen[ how? ] so the curve closely resembled the gamma-2.2 curve. This gives X ≈ 0.0392857, Φ ≈ 12.9232102. These values, rounded to X = 0.03928, Φ = 12.92321 sometimes describe sRGB conversion. [5]

Draft publications by sRGB's creators further rounded Φ = 12.92, [2] 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. [6] For the standard, the rounded value of Φ was kept and X was recomputed as 0.04045 to make the curve continuous, resulting in a slope discontinuity from 1/12.92 below the intersection to 1/12.70 above.

Viewing environment

CIE 1931 xy chromaticity diagram showing the gamut of the sRGB color space (the triangle). The outer curved boundary is the spectral (or monochromatic) locus, with wavelengths shown in nanometers (labeled in blue). This image is drawn using sRGB, so colors outside the triangle cannot be accurately colored and have been interpolated. The D65 white point is shown in the center, and the Planckian locus is shown with color temperatures labeled in kelvins. D65 is not an ideal 6504-kelvin black body because it is based on atmospheric filtered daylight. Cie Chart with sRGB gamut by spigget.png
CIE 1931 xy chromaticity diagram showing the gamut of the sRGB color space (the triangle). The outer curved boundary is the spectral (or monochromatic) locus, with wavelengths shown in nanometers (labeled in blue). This image is drawn using sRGB, so colors outside the triangle cannot be accurately colored and have been interpolated. The D65 white point is shown in the center, and the Planckian locus is shown with color temperatures labeled in kelvins. D65 is not an ideal 6504-kelvin black body because it is based on atmospheric filtered daylight.
ParameterValue
Screen luminance level80 cd/m2
Illuminant white point x = 0.3127, y = 0.3290 (D65)
Image surround reflectance20% (~medium gray)
Encoding ambient illuminance level64 lux
Encoding ambient white pointx = 0.3457, y = 0.3585 (D50)
Encoding viewing flare1.0%
Typical ambient illuminance level200 lux
Typical ambient white pointx = 0.3457, y = 0.3585 (D50)
Typical viewing flare5.0%

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. [7] [8] 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. [2]

Transformation

From sRGB to CIE XYZ

The sRGB component values , , 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.

where is , , or .

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 non-zeroes is not allowed):

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, 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, [1] [9] which corrected small rounding errors in the original publication [2] by sRGB's creators, and assume the 2° standard colorimetric observer for CIE XYZ. [2] ) This matrix depends on the bitdepth.

These linear RGB values are not the final result; gamma correction must still be applied. The following formula transforms the linear values into sRGB:

where is , , or .

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

Comparison of some RGB and CMYK colour gamuts on a CIE 1931 xy chromaticity diagram CIE1931xy gamut comparison.svg
Comparison of some RGB and CMYK colour gamuts on a CIE 1931 xy chromaticity diagram

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 not 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 or a lookup 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, [10] 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 power-law functions. [10] Nevertheless, lookup tables are more commonly used as they are computationally more efficient.[ citation needed ] Even when parametric curves are used, software will often reduce to a run-time lookup table for efficient processing.[ citation needed ]

As the sRGB gamut meets or exceeds the gamut of a low-end inkjet printer, 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 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. Such 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, [11] added to the core in OpenGL 2.1) and rendering into sRGB gamma encoded framebuffers (first introduced with EXT_framebuffer_sRGB extension, [12] 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. [13]

sYCC

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. sYCC uses 8 bits for the components resulting in a range of approximately 01 for Y; -0.50.5 for C. [14] The amendment also contains a 10-bit-or-more encoding called bg-sRGB where 01 is mapped to -384510...639510, and bg-sYCC using the same number of bits for a range of approximately -0.751.25 for Y; -11 for C. [14]

As this conversion can result in sRGB values outside the range 01, 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.

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

. [14]

Related Research Articles

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:

<span class="mw-page-title-main">Y′UV</span> Mathematical color model

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.

<span class="mw-page-title-main">Ellipsoid</span> Quadric surface that looks like a deformed sphere

An ellipsoid is a surface that can be obtained from a sphere by deforming it by means of directional scalings, or more generally, of an affine transformation.

In the mathematical field of differential geometry, a metric tensor is an additional structure on a manifold M that allows defining distances and angles, just as the inner product on a Euclidean space allows defining distances and angles there. More precisely, a metric tensor at a point p of M is a bilinear form defined on the tangent space at p, and a metric field on M consists of a metric tensor at each point p of M that varies smoothly with p.

<span class="mw-page-title-main">CIELAB color space</span> Standard color space with color-opponent values

The CIELAB color space, also referred to as L*a*b*, is a color space defined by the International Commission on Illumination in 1976. It expresses color as three values: L* for perceptual lightness and a* and b* for the four unique colors of human vision: red, green, blue and yellow. CIELAB was intended as a perceptually uniform space, where a given numerical change corresponds to a similar perceived change in color. While the LAB space is not truly perceptually uniform, it nevertheless is useful in industry for detecting small differences in color.

<span class="mw-page-title-main">Grayscale</span> Image where each pixels intensity is shown only achromatic values of black, gray, and white

In digital photography, computer-generated imagery, and colorimetry, a 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, a kind of black-and-white or gray monochrome, are composed exclusively of shades of gray. The contrast ranges from black at the weakest intensity to white at the strongest.

Differential geometry of curves is the branch of geometry that deals with smooth curves in the plane and the Euclidean space by methods of differential and integral calculus.

<span class="mw-page-title-main">YCbCr</span> Family of digital colour spaces

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-difference and red-difference chroma components. Y′ is distinguished from Y, which is luminance, meaning that light intensity is nonlinearly encoded based on gamma corrected RGB primaries.

<span class="mw-page-title-main">Adobe RGB color space</span> Color space developed by Adobe

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.

<span class="mw-page-title-main">Pushforward (differential)</span> Linear approximation of smooth maps on tangent spaces

In differential geometry, pushforward is a linear approximation of smooth maps on tangent spaces. Suppose that is a smooth map between smooth manifolds; then the differential of at a point , denoted , is, in some sense, the best linear approximation of near . It can be viewed as a generalization of the total derivative of ordinary calculus. Explicitly, the differential is a linear map from the tangent space of at to the tangent space of at , . Hence it can be used to push tangent vectors on forward to tangent vectors on . The differential of a map is also called, by various authors, the derivative or total derivative of .

<span class="mw-page-title-main">CIE 1931 color space</span> Color space defined by the CIE in 1931

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 define these color spaces are essential tools for color management, important when dealing with color inks, illuminated displays, and recording devices such as digital cameras. The system was designed in 1931 by the "Commission Internationale de l'éclairage", known in English as the International Commission on Illumination.

<span class="mw-page-title-main">LMS color space</span> Color space represented by the response of the three types of cones of the human eye

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.

The gradient theorem, also known as the fundamental theorem of calculus for line integrals, says that a line integral through a gradient field can be evaluated by evaluating the original scalar field at the endpoints of the curve. The theorem is a generalization of the second fundamental theorem of calculus to any curve in a plane or space rather than just the real line.

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 Wide color gamut RGB color space

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.

<span class="mw-page-title-main">Rec. 709</span> Standard for HDTV image encoding and signal characteristics

Rec. 709, also known as Rec.709, BT.709, and ITU 709, is a standard developed by ITU-R for image encoding and signal characteristics of high-definition television.

<span class="mw-page-title-main">Stokes' theorem</span> Theorem in vector calculus

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: The line integral of a vector field over a loop is equal to the surface integral of its curl over the enclosed surface. It is illustrated in the figure, where the direction of positive circulation of the bounding contour ∂Σ, and the direction n of positive flux through the surface Σ, are related by a right-hand-rule. For the right hand the fingers circulate along ∂Σ and the thumb is directed along n.

The Academy Color Encoding System (ACES) is a color image encoding system created under the auspices of the Academy of Motion Picture Arts and Sciences. ACES is characterised by a color accurate workflow, with "seamless interchange of high quality motion picture images regardless of source".

<i>ICtCp</i>

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.

References

  1. 1 2 3 4 5 6 "IEC 61966-2-1:1999". IEC Webstore. International Electrotechnical Commission. Retrieved 3 March 2017.
  2. 1 2 3 4 5 6 Michael Stokes; Matthew Anderson; Srinivasan Chandrasekar; Ricardo Motta (November 5, 1996). "A Standard Default Color Space for the Internet – sRGB, Version 1.10". Archived from the original on Jul 3, 2023.
  3. Charles A. Poynton (2003). Digital Video and HDTV: Algorithms and Interfaces. Morgan Kaufmann. ISBN   1-55860-792-7.
  4. "The Importance of Terminology and sRGB Uncertainty". Colour Science. 2015-12-05. Retrieved 2021-11-05.
  5. Phil Green & Lindsay W. MacDonald (2002). Colour Engineering: Achieving Device Independent Colour. John Wiley and Sons. ISBN   0-471-48688-4.
  6. Jon Y. Hardeberg (2001). Acquisition and Reproduction of Color Images: Colorimetric and Multispectral Approaches. Universal-Publishers.com. ISBN   1-58112-135-0.
  7. Rodney, Andrew (2005). Color Management for Photographers. Focal Press. p. 121. ISBN   978-0-240-80649-5.
  8. "Why Calibrate Monitor to D65 When Light Booth is D50". X-Rite. Retrieved 2022-09-11.
  9. "How to interpret the sRGB color space" (PDF). color.org. Retrieved 17 October 2017.
  10. 1 2 sRGB profiles, ICC
  11. "EXT_texture_sRGB". 24 January 2007. Retrieved 12 May 2020.
  12. "EXT_framebuffer_sRGB". 17 September 2010. Retrieved 12 May 2020.
  13. "GPU Gems 3: Chapter 24. The Importance of Being Linear, section 24.4.1". NVIDIA Corporation. Retrieved 3 March 2017.
  14. 1 2 3 "IEC 61966-2-1:1999 Multimedia systems and equipment – Colour measurement and management – Part 2-1: Colour management – Default RGB colour space – sRGB: Amendment 1". International Electrotechnical Commission. 2003.

Standards