SRGB color space
Encyclopedia
sRGB is a standard RGB color space
RGB color space
An RGB color space is any additive color space based on the RGB color model. A particular RGB color space is defined by the three chromaticities of the red, green, and blue additive primaries, and can produce any chromaticity that is the triangle defined by those primary colors...

 created cooperatively by HP
Hewlett-Packard
Hewlett-Packard Company or HP is an American multinational information technology corporation headquartered in Palo Alto, California, USA that provides products, technologies, softwares, solutions and services to consumers, small- and medium-sized businesses and large enterprises, including...

 and Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 in 1996 for use on monitors, printers, and the Internet
Internet
The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite to serve billions of users worldwide...

.

sRGB uses the ITU-R BT.709
Rec. 709
ITU-R Recommendation BT.709, more commonly known by the abbreviations Rec. 709 or BT.709, standardizes the format of high-definition television, having 16:9 aspect ratio. The first edition of the standard was approved in 1990....

 primaries, the same as are used in studio monitors and HDTV, and a transfer function (gamma curve
Gamma correction
Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma, is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or still image systems...

) typical of CRTs
Cathode ray tube
The cathode ray tube is a vacuum tube containing an electron gun and a fluorescent screen used to view images. It has a means to accelerate and deflect the electron beam onto the fluorescent screen to create the images. The image may represent electrical waveforms , pictures , radar targets and...

. 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 space
RGB color space
An RGB color space is any additive color space based on the RGB color model. A particular RGB color space is defined by the three chromaticities of the red, green, and blue additive primaries, and can produce any chromaticity that is the triangle defined by those primary colors...

s, the sRGB gamma
Gamma correction
Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma, is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or still image systems...

 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 non-linear 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
World Wide Web Consortium
The World Wide Web Consortium is the main international standards organization for the World Wide Web .Founded and headed by Tim Berners-Lee, the consortium is made up of member organizations which maintain full-time staff for the purpose of working together in the development of standards for the...

, Exif, Intel, Pantone
Pantone
Pantone Inc. is a corporation headquartered in Carlstadt, New Jersey, USA. The company is best known for its Pantone Matching System , a proprietary color space...

, Corel
Corel
Corel Corporation from the abbreviation is a computer software company headquartered in Ottawa, Ontario, that specializes in graphics processing, similar to Adobe Systems...

, and many other industry players; it is used in proprietary and open graphics file formats, such as SVG
Scalable Vector Graphics
Scalable Vector Graphics is a family of specifications of an XML-based file format for describing two-dimensional vector graphics, both static and dynamic . The SVG specification is an open standard that has been under development by the World Wide Web Consortium since 1999.SVG images and their...

.

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.

Nearly all software is now designed with the assumption that an 8-bit-per-channel image file placed unchanged onto an 8-bit-per-channel display will appear much as the sRGB specification dictates. LCDs, digital cameras
Digital photography
Digital photography is a form of photography that uses an array of light sensitive sensors to capture the image focused by the lens, as opposed to an exposure on light sensitive film...

, printers, and scanners all follow the sRGB standard. Devices which do not naturally follow sRGB (as was the case for older CRT monitors) 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 8-bit-per-channel image file or any 8-bit-per-channel image API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 or device interface can be treated as being in the sRGB color space. When an RGB color space with a larger gamut is needed, color management
Color management
In digital imaging systems, color management is the controlled conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, computer printers, offset presses, and corresponding media.The primary goal of color...

 usually must be employed to map image data to appear correctly on the display.

The sRGB gamut

sRGB defines the chromaticities of the red, green, and blue primaries
Primary color
Primary colors are sets of colors that can be combined to make a useful range of colors. For human applications, three primary colors are usually used, since human color vision is trichromatic....

, the colors where one of the three channels is nonzero and the other two are zero. The gamut
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 circumstance, such as within a given color space or by a...

 of chromaticities that can be represented in sRGB is the color triangle
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 triangle, when the amounts of the primaries are constrained to be...

 defined by these primaries. As with any RGB color space
RGB color space
An RGB color space is any additive color space based on the RGB color model. A particular RGB color space is defined by the three chromaticities of the red, green, and blue additive primaries, and can produce any chromaticity that is the triangle defined by those primary colors...

, 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.
Chromaticity Red Green Blue White point
x 0.6400 0.3000 0.1500 0.3127
y 0.3300 0.6000 0.0600 0.3290
z 0.0300 0.1000 0.7900 0.3583

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 integer-based image file to display human-discernible light levels.

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.

The forward transformation (CIE xyY or CIE XYZ to sRGB)

The first step in the calculation of sRGB tristimulus values from the CIE XYZ
CIE 1931 color space
In the study of color perception, one of the first mathematically defined color spaces is the CIE 1931 XYZ color space, created by the International Commission on Illumination in 1931....

 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 61966-2-1:1999) and differ slightly from those in a publication by sRGB's creators. Note that these linear values are not the final result.


Note also, that if the CIE xyY color space values are given (where x, y are the chromaticity coordinates and Y is the luminance
Luminance
Luminance is a photometric measure of the luminous intensity per unit area of light travelling in a given direction. It describes the amount of light that passes through or is emitted from a particular area, and falls within a given solid angle. The SI unit for luminance is candela per square...

), they must first be transformed to CIE XYZ tristimulus values by:


The intermediate parameters , and for in-gamut 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.

sRGB was designed to reflect a typical real-world monitor with a gamma of 2.2, and the following formula transforms the linear values into sRGB. Let be , , or , and be , or :
  • where

These gamma-corrected values are in the range 0 to 1. 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.

The reverse transformation

Again the sRGB component values , , are in the range 0 to 1. (A range of 0 to 255 can simply be divided by 255).

(where is , , or ). Followed by a matrix multiplication of the linear values to get XYZ:

Theory of the transformation

It is often casually stated that the decoding gamma
Gamma correction
Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma, is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or still image systems...

 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 condition that g(K) match at some K0 is


Solving with and the standard value yields two solutions, or . The IEC 61966-2-1 standard uses the rounded value . However, if we impose the condition that the slope match as well then we must have


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


Substituting and gives and , with the corresponding linear-domain threshold at . These values, rounded to , , and , are sometimes used to describe sRGB conversion. Publications by sRGB's creators rounded to and , resulting in a small discontinuity in the curve. Some authors adopted these values in spite of the discontinuity. For the standard, the rounded value was kept and the 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/m2
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. The other parameters, such as the luminance level, are representative of a typical CRT monitor.

For optimal results, the ICC
International Color Consortium
The International Color Consortium was formed in 1993 by eight industry vendors in order to create a universal color management system that would function transparently across all operating systems and software packages....

 recommends using the encoding viewing environment (i.e., dim, diffuse lighting) rather than the less-stringent typical viewing environment.

Usage

As the recommended color space for the Internet, sRGB should be used for editing and saving all images intended for publication to the World Wide Web
World Wide Web
The World Wide Web is a system of interlinked hypertext documents accessed via the Internet...

.

Due to the standardization of sRGB on the Internet, on computers, and on printers, many low- to medium-end consumer digital camera
Digital camera
A digital camera is a camera that takes video or still photographs, or both, digitally by recording images via an electronic image sensor. It is the main device used in the field of digital photography...

s and scanners
Image scanner
In computing, an image scanner—often abbreviated to just scanner—is a device that optically scans images, printed text, handwriting, or an object, and converts it to a digital image. Common examples found in offices are variations of the desktop scanner where the document is placed on a glass...

 use sRGB as the default
Default (computer science)
A default, in computer science, refers to a setting or value automatically assigned to a software application, computer program or device, outside of user intervention. Such settings are also called presets, especially for electronic devices...

 (or only available) working color space. As the sRGB gamut meets or exceeds the gamut of an inkjet printer
Inkjet printer
An inkjet printer is a type of computer printer that creates a digital image by propelling droplets of ink onto paper. Inkjet printers are the most commonly used type of printer and range from small inexpensive consumer models to very large professional machines that can cost up to thousands of...

, an sRGB image is often regarded as satisfactory for home use. 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- to 16-bit 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
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...

 may be used; the ICC distributes three such profiles: 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 color-managed workflow, e.g. prepress
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...

 output, sometimes use another color space such as Adobe RGB (1998)
Adobe RGB color space
The Adobe RGB color space is an RGB color space developed by Adobe Systems 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 the computer display...

, 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
Color management
In digital imaging systems, color management is the controlled conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, computer printers, offset presses, and corresponding media.The primary goal of color...

 tools that are usually included with software that works in these other color spaces.

The two dominant programming interfaces for 3D graphics, OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

 and Direct3D, have both incorporated support for the sRGB gamma curve.
OpenGL supports the textures
Texture mapping
Texture mapping is a method for adding detail, surface texture , or color to a computer-generated graphic or 3D model. Its application to 3D graphics was pioneered by Dr Edwin Catmull in his Ph.D. thesis of 1974.-Texture mapping:...

 with sRGB-encoded color components (first introduced with EXT_texture_sRGB extension, added to the core in OpenGL 2.1) and rendering into sRGB-encoded framebuffer
Framebuffer
A framebuffer is a video output device that drives a video display from a memory buffer containing a complete frame of data.The information in the memory buffer typically consists of color values for every pixel on the screen...

s (first introduced with EXT_framebuffer_sRGB extension, added to the core in OpenGL 3.0). Direct3D supports sRGB textures and rendering into sRGB surfaces starting with DirectX 9. Correct mipmap
Mipmap
In 3D computer graphics texture filtering, MIP maps are pre-calculated, optimized collections of images that accompany a main texture, intended to increase rendering speed and reduce aliasing artifacts. They are widely used in 3D computer games, flight simulators and other 3D imaging systems. The...

ing and interpolation
Interpolation
In the mathematical field of numerical analysis, interpolation is a method of constructing new data points within the range of a discrete set of known data points....

 of sRGB 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 do not have any performance penalty.

Standards

  • IEC 61966-2-1:1999 is the official specification of sRGB. It provides viewing environment, encoding, and colorimetric details.
  • Amendment A1:2003 to IEC 61966-2-1:1999 describes an analogous sYCC encoding for YCbCr
    YCbCr
    YCbCr or Y′CbCr, sometimes written or , 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...

     color spaces, an extended-gamut
    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 circumstance, such as within a given color space or by a...

     RGB encoding, and a CIELAB transformation.
  • The fourth working draft of IEC 61966-2-1 is available online, but is not the complete standard.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK