(Redirected from SRGB color space)

CIE 1931 xy
chromaticity diagram showing the
gamut of the sRGB color space and location of the primaries. The D65
white point is shown in the center. Note that areas outside the triangle cannot be accurately colored, because they are out of the
gamut of computer displays.

Plot of the sRGB intensities versus sRGB numerical values (red), and this function's slope in log-log space (blue) which is the effective gamma at each point. 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' is a standard
RGB (Red Green Blue) color space created cooperatively by
HP and
Microsoft for use on monitors, printers, and the
Internet. It was originally proposed in 1995 by Ralf Kuron of FOGRA as a pragmatic approach in connection to
ICC. It has been endorsed by the
W3C,
Exif,
Intel,
Pantone,
Corel, and many other industry players, is also well accepted by
open-source software such as the
GIMP, and 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. It uses the ITU-R BT.709-2 reference primaries, (the same as are used in an SMPTE broadcast monitor) and a transfer function (
gamma curve) typical of CRTs. This specification allows sRGB to be directly displayed by non-ICC-aware applications on typical monitors, a factor which greatly aided its acceptance. Nearly all software was and is designed with the assumption that an 8-bit/channel image file placed unchanged onto an 8-bit/channel display will appear much as the sRGB specification dictates.
LCD displays,
digital cameras, printers, and scanners all follow the sRGB standard. Devices which do not naturally follow sRGB (as older CRT monitors did) include compensating circuitry or software so that in the end they also obey this standard (this is somewhat less true for high-end professional equipment, which still generally defaults to sRGB). For this reason, one can assume (in the absence of embedded profiles or any other information) that any 8-bit/channel image file, and any 8-bit/channel image API or device interface, is in the sRGB color space.
The sRGB
gamma can not 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.
Overview
sRGB defines the chromaticities of the red, green, and blue
primaries, the colors where one of the three channels is at the maximum value and the other two are at zero. In
CIE xy chromaticity coordinates red is at [0.6400, 0.3300], green is at [0.3000, 0.6000], and blue is at [0.1500, 0.0600], and the
white point is the D65 white point at [0.3127,0.3290]. As with any
RGB color space, for non-negative values of R, G, and B it is not possible to represent colors outside the color triangle defined by the primaries, the chromaticity
gamut, which is well inside the range of colors visible to a human.
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-discernable light levels.
sRGB is sometimes avoided by high-end 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. See
RGB color space for the view that
Adobe RGB is a preferred colorspace for publishing.
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.
[1] 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), 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).
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
:
Theory of the transformation
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
is
:
where the standard value of
which was used above, yields
=0.04045.. and this is the transformation used. 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
=0.03928.. and
=12.9232... These values are sometimes used for the sRGB specification, although they are not standard.
Usage
As the recommended color space for the Internet, sRGB should be used for
editing and saving all images intended for publication to the WWW; however, due to sRGB's somewhat limited
gamut, images intended for professional printing via a fully color-managed workflow, e.g.,
prepress output, should choose another color space such as
Adobe RGB (1998), which allows for a wider gamut.
Images intended for the Internet and created in one of the other color spaces may be converted to sRGB when editing, using a suitable editing program, e.g.,
Paint Shop Pro or
Adobe Photoshop; ideally, the original non-sRGB file should be saved and the conversion to sRGB done on a copy, as some loss of image information occurs when converting to the narrower color space.
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. Used in conjunction with an
inkjet printer, an sRGB image produces what is often regarded as satisfactory for home use. However, consumer-level camera LCDs are typically uncalibrated, meaning that even though the image is being labelled as sRGB, one can't conclude that the image is color-accurate on the LCD.
The two dominant programming interfaces for 3D graphics,
OpenGL and
Direct3D, have both incorporated sRGB. OpenGL 2.1 incorporates sRGB textures first introduced by the
EXT_texture_sRGB extension. OpenGL's
EXT_framebuffer_sRGB extension supports rendering into framebuffers assuming either a linear or sRGB color space.
DirectX 9 supports sRGB textures and rendering into sRGB surfaces using Direct3D.
References
★ 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 color spaces, an extended-
gamut RGB encoding, and a
CIELAB transformation.
★ The
fourth working draft of IEC 61966-2-1 is available online, but is not the complete standard.
1. sRGB description with XYZ conversion formula
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
★
A Standard Default Color Space for the Internet - sRGB
★
OpenGL extension for sRGB textures
★
Comparison of sRGB and AdobeRGB