Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

sRGB

From Wikipedia, the free encyclopedia
Standard RGB color space


sRGB
IEC 61966-2-1 Default RGB Colour Space - sRGB
sRGB colors situated at calculated position inCIE 1931 chromaticity diagram.Y=1/3 which is the brightest luminance where the whole triangle exists.
AbbreviationsRGB
StatusPublished
Year started1996
First publishedOctober 18, 1999; 25 years ago (1999-10-18)[1]
OrganizationIEC[1]
CommitteeTC/SC: TC 100/TA 2[1]
Base standardsIEC 61966 Colour Measurement and Management in Multimedia Systems and Equipment
DomainColor space,color model
Websitewebstore.iec.ch/publication/6169
For the ancillary chunk in the PNG file format, seePNG § Ancillary chunks.

sRGB is anRGB (red, green, blue)colorspace, for use on monitors, printers, and theWorld Wide Web. It was initially proposed byHP andMicrosoft in 1996[2] and became an official standard of theInternational Electrotechnical Commission (IEC) as IEC 61966-2-1:1999.[1] It is the current standard colorspace for the web, and it is usually the assumed colorspace for images that do not have anembedded color profile.

The sRGB standard uses the same color primaries and white point as theITU-R BT.709 standard forHDTV,[3] but a differenttransfer function (orgamma) compatible with the era'sCRT displays,[4] and assumes a viewing environment closer to typical home and office viewing conditions. Matching the behavior of PC video cards and CRT displays greatly aided sRGB's popularity.

History

[edit]

By the 1970's most computerstranslated 8-bit digital data fairly linearly to a signal that was sent to a video monitor. However video monitors and TVs produced a brightness that was not linear with the input signal, roughly a power law with an exponent between 2 and 3. The exponent was commonly denoted with the letterγ{\displaystyle \gamma }, hence the common name "gamma correction" for this function. This design has the fortunate benefit of displaying an image with much less visual artifacts, as it places the digital values closer together near black and further apart near white (where changes in brightness are less visible). This gamma varied according to CRT manufacturers, but was normalized in 1993 for use in HDTV systems, as theITUBT.709 standard[5] The BT.709 standard specified a decoding function with a linear section near zero, transitioning to a shifted power law with exponent 1/0.45 ≈ 2.22...

sRGB was created a few years later by Hewlett-Packard and Microsoft. It was meant to describe the decoding function of mostCRT computer monitors used with Windows operating systems at the time, which was still different from that assumed by BT.709.[6] The first draft of the standard[2] was published in 1996. A fourth draft, still incomplete, is available online.[7] Like the BT.709, the sRGB decoding function was defined as a linear section near zero that transitions to a shifted power law[8][9]

Actually using the sRGB standard became important as computer graphics software started to calculate in linear light levels in the late 1990s,[citation needed] and needed to use sRGB to convert from and to the common 8-bit image standards.

On an sRGB display, each solid bar should look as bright as the surrounding striped dither. (Note: must be viewed at original, 100% size)

Images such as shown here became popular for adjusting a CRT monitor to correctly display sRGB.

Amendment 1 to IEC 61966-2-1:1999, approved in 2003, also defines a Yuv-style colorspace calledsYCC and a conversion to more than 8 bits calledbg-sRGB. ThescRGB standard also tries to extend sRGB to more bits.

Definition

[edit]

Transfer function ("gamma")

[edit]
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.

An sRGB image file containsR′G′B′ values for each pixel. 0.0 is "black" while 1.0 is the intensity of a color primary needed by "white". These floating-point values are derived from the file data, for a typical 8-bit-per-channel image the bytes are divided by 255.0.

The mapping from these values to intensity is a non-lineartransfer function which is the combination of alinear function at low brightness values and a displacedpower law for the rest of the range. Linear intensitiesRGB are derived using (same for all channels):[10]

R={R/12.92,R0.04045(R+0.0551.055)2.4,R>0.04045{\displaystyle R={\begin{cases}R'/12.92,&R'\leq 0.04045\\[5mu]\left({\frac {\displaystyle R'+0.055}{\displaystyle 1.055}}\right)^{2.4},&R'>0.04045\end{cases}}}

This function is quite close toR2.2{\displaystyle R'^{2.2}}. However, for low values near 0.04045 the difference is perceptible.[4][11]

The inverse function as defined by IEC2003 is:[10]

R={12.92R,R0.0031308(1.055)R1/2.40.055,R>0.0031308{\displaystyle R'={\begin{cases}12.92R,&R\leq 0.0031308\\[5mu](1.055)R^{1/2.4}-0.055,&R>0.0031308\end{cases}}}

If needed by the file format, values greater than 1.0 can be used (the results will also be greater than 1.0), and values less than 0.0 can be converted as-f(-x).[10]

These functions are similar to those of BT.709, but the values are noticeably different.[4] Because of the rounding of the parameters, they have small discontinuities at the transition between the linear and non-linear part, on the order of 10−8, and they are not precise inverses of each other. These errors are too small to matter in practical situations.[12]In practice many pieces of software use different close-by values (see below), or ignore the linear section, or use a plain gamma 2.2 function. The change in the images is almost imperceptible, however it will make noticeable seams when differently-converted images are overlapped, and mismatched translations back and forth accumulate color shifts.[13] Many operating systems and programs send 8-bit sRGB images directly to video memory and assume this produces the correct levels.[11]

Deriving the transfer function

[edit]

A shifted power law curve that passes through(1,1) isy=(x+C1+C)Γ{\displaystyle y=\left({\frac {x+C}{1+C}}\right)^{\Gamma }}.

The first draft of the sRGB standard choseΓ=2.4{\displaystyle \Gamma =2.4} and then computedC=0.055{\displaystyle C=0.055}[2] so that the value atx=0.4{\displaystyle x=0.4} was nearx2.2{\displaystyle x^{2.2}}.[citation needed]

A straight line that passes through(0,0), isy=x/A{\displaystyle y=x/A}.

The transition from the linear section to the power law section should becontinuous (without a sudden step) andsmooth (without a sudden change of slope).[6] To make it continuous whenx=X, we must have

XA=(X+C1+C)Γ{\displaystyle {\frac {X}{A}}=\left({\frac {X+C}{1+C}}\right)^{\Gamma }}

To avoid a sudden change of slope where the two segments meet, the derivatives must also be equal atX:

1A=Γ(X+C1+C)Γ1(11+C){\displaystyle {\frac {1}{A}}=\Gamma \left({\frac {X+C}{1+C}}\right)^{\Gamma -1}\left({\frac {1}{1+C}}\right)}

Solving the two equations forX andA we get

X=CΓ1A=(1+C)Γ(Γ1)Γ1(CΓ1)(ΓΓ){\displaystyle X={\frac {C}{\Gamma -1}}\;\;\;\;\;A={\frac {(1+C)^{\Gamma }(\Gamma -1)^{\Gamma -1}}{(C^{\Gamma -1})(\Gamma ^{\Gamma })}}}

This producesX0.0392857...{\displaystyle X\approx 0.0392857...} andA12.9232102...{\displaystyle A\approx 12.9232102...}. These values, rounded toX=0.03928{\displaystyle X=0.03928} andA=12.92321{\displaystyle A=12.92321} are still incorrectly given in some publications.[14]

However, the sRGB draft standard roundedA{\displaystyle A} to12.92{\displaystyle 12.92},[2] resulting in a small discontinuity in the curve.

The first official version of the standard was defined and published by the IEC in 1999. In this version, the rounded value ofA=12.92{\displaystyle A=12.92} was retained, but the breakpointX{\displaystyle X} was redefined as0.04045{\displaystyle 0.04045} to make the curve approximately continuous. With these values, there is still a discontinuity in the slope, from1/12.92{\displaystyle 1/12.92} just below the intersection to1/12.70{\displaystyle 1/12.70} just above it. The final standard also corrected some small rounding errors present in the draft.[2]

Primaries

[edit]
CIE values of sRGB primaries
RedGreenBlueWhite point
x0.64000.30000.15000.3127
y0.33000.60000.06000.3290
Y0.21260.71520.07221.0000

The sRGB standard defines thechromaticities of the red, green, and blueprimaries, the colors where one of the three channels is nonzero and the other two are zero. Thegamut of chromaticities that can be represented in sRGB is thecolor 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 normaltrichromatic vision. As with anyRGB color space, for non-negative values ofR,G, andB 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. Sinceflat-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]

The sRGB standard specifies also the colors and relative intensities of the three primariesR,G, andB, by defining the mapping between these values (in linear brightness scale, before the gamma encoding) and theCIE XYZ perceptual color coordinates.[15] This mapping is the same specified by the BT.709 standard; in matrix notation,[10]

[XYZ]=[0.41240.35760.18050.21260.71520.07220.01930.11920.9505][RGB]{\displaystyle {\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\\G\\B\end{bmatrix}}}

These coefficients should be considered exact[1] and assume the 2°standard colorimetric observer for CIE XYZ.[2][16] In particular, the second row of this matrix specifies the computation of theBT.709-2 luma (brightness) value from the linearR,G, andB values. (BT.709-1 had a typo in these coefficients.)

The inverse conversion, from from CIE XYZ to (linear)RGB, can be obtained by inverting the matrix above to a suitable numerical accuracy. The 1999 standard provides the matrix

[RGB]=[+3.24061.53720.49860.9689+1.8758+0.0415+0.05570.2040+1.0570][XYZ]{\displaystyle {\begin{bmatrix}R\\G\\B\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}}}

which is not the exact inverse of the sRGB to XYZ transformation, but was expected to be accurate enough for 8-bit encoded samples (withM=255{\displaystyle M=255}).

The 1999 IEC standard was amended in 2003.[10] The sRGB to CIE XYZ matrix was retained, but the inverse transformation above was replaced by a more accurate version, with seven decimal fraction digits. It provides the matrix

[RGB]=[+3.24062551.53720800.49862860.9689307+1.8757561+0.0415175+0.05571010.2040211+1.0569959][XYZ]{\displaystyle {\begin{bmatrix}R\\G\\B\end{bmatrix}}={\begin{bmatrix}+3.2406255&-1.5372080&-0.4986286\\-0.9689307&+1.8757561&+0.0415175\\+0.0557101&-0.2040211&+1.0569959\end{bmatrix}}{\begin{bmatrix}X\\Y\\Z\end{bmatrix}}}.

which is claimed to be sufficiently accurate for samples withN=16{\displaystyle N=16} bits (M=65535{\displaystyle M=65535}).

For these formulas, theX,Y, andZ values must be scaled so that theY ofD65 ("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 inCIELAB, when using specified white points).

Viewing environment

[edit]
CIE 1931 xychromaticity diagram showing thegamut 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. TheD65white point is shown in the center, and thePlanckian locus is shown with color temperatures labeled inkelvins. D65 is not an ideal 6504-kelvinblack body because it is based on atmospheric filtered daylight.

The sRGB specification assumes a dimly lit encoding (creation) environment with an ambient correlated color temperature (CCT) of 5003 K:

ParameterValue
Screenluminance level80 cd/m2
Illuminantwhite pointx = 0.3127,y = 0.3290 (D65)
Image surround reflectance20% (~medium gray)
Encoding ambient illuminance level64lux
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 assumed ambient CCT differs from that of the BT.709 standard illuminant (D65), which is still retained for the screen white point. UsingD50 for both would have made the white point of most photographic paper appear excessively blue.[17][18] The other parameters, such as the luminance level, are representative of a typical CRT monitor.

For optimal results, theICC recommends using the encoding viewing environment (i.e., dim, diffuse lighting) rather than the less-stringent typical viewing environment.[19]

Translation to integers

[edit]

Most file formats that use sRGB store 8-bit integers. Usually these are converted from 8 bits by dividing by 255.0, and converted to 8 bits by multiplying by 255 and rounding. However some software converts to 8 bits by multiplying by 256 and rounding down. Higher-quality software often usesdithering when writing so thatcolor banding is hidden.

Annex G of the 2003 amendment of the sRGB standard describes an alternative encoding of color values, calledbg-sRGB, that is recommended when the number of bits per channel is 10 or more. In this case 0.0 is mapped to ablack pointK and 1.0 is mapped to awhite pointW, with all other values interpreted linearly. For 10 bitsK = 384 andW = 894 is specified, and for larger numbersN of bits:

K=3×2N3W=K+255×2N9{\displaystyle K=3\times 2^{N-3}\quad \quad W=K+255\times 2^{N-9}}

The 12-bitscRGB format does something similar, withK = 1024 andW = 2304.

Allowing numbers greater than 1.0 allowshigh dynamic range images, and negative numbers allows colors outside the gamut triangle.[10]

Usage

[edit]
Comparison of some RGB and CMYK colour gamuts on aCIE 1931 xychromaticity diagram

Due to the standardization of sRGB on the Internet, on computers, and on printers, many low- to medium-end consumerdigital cameras andscanners use sRGB as thedefault (or only available) working color space.[20] If the color space of an image is unknown and encoded with 8 bits in each channel, the sRGB encoding can be assumed. Due to programmers misunderstanding the meaning of "gamma" some image files that claim they contain a gamma of 1.0 should also be assumed to be sRGB.[citation needed]

As the sRGB gamut mostly meets or exceeds the gamut of a low-endinkjet printer, an sRGB image is often regarded as satisfactory for home printing. The sRGB color space 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 inCMYK printing. Images intended for professional printing via a fully color-managed workflow (e.g.prepress output) sometimes use another color space such asAdobe RGB (1998), which accommodates a wider gamut and CMYK color space like Fogra39.

Programming interface support

[edit]

The two dominant programming interfaces for 3D graphics,OpenGL andDirect3D, have both incorporated support for the sRGB gamma curve. OpenGL supportstextures with sRGB gamma encoded color components (first introduced with EXT_texture_sRGB extension,[21] added to the core in OpenGL 2.1) and rendering into sRGB gamma encodedframebuffers (first introduced with EXT_framebuffer_sRGB extension,[22] added to the core in OpenGL 3.0). Correctmipmapping andinterpolation of sRGB gamma textures has direct hardware support in texturing units of most modernGPUs (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.[23]

ICC profiles

[edit]

Alookup table may be used to efficiently convert sRGB to other color spaces.[citation needed] TheInternational Color Consortium (ICC) has publishedcolor profiles for this purpose, which are widely used.[19][16] There are several variants,[24] includingICCmax, 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.[25] However, inconsistencies have been pointed out between those ICC profiles and the IEC sRGB standard.[26] In particular, version 2 of the ICC profile specification does not implement the piecewise parametric curve encoding ("para") as specified by the IEC sRGB standard,[27] and has to implement the sRGB transfer function using a one-dimensional lookup table.[24] Some implementations approximate the transfer function as 2.2 gamma, with no linear portion, called "simplified sRGB".[28]

References

[edit]
  1. ^abcdef"IEC 61966-2-1:1999".IEC Webstore. International Electrotechnical Commission. Retrieved3 March 2017.. The first official specification of sRGB.
  2. ^abcdefMichael 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. ^abcImage Engineering GmbH (2012): "Color spaces - REC.709 vs. sRGB Online document at www.image-engineering.de. Includes a graph comparing two transfer functions. Accessed on 2024-12-17.
  5. ^"BT.709 : Parameter values for the HDTV standards for production and international programme exchange".www.itu.net. n.d. Retrieved2021-04-19.
  6. ^absRGB.com Notes on design and use of sRGB (archived) byHP.
  7. ^fourth working draft (4WD) for 2CD of IEC 61966-2-1, (archived). Still not the complete standard.
  8. ^Roberts, A.BBC RD 1991/6 Methods of Measuring and Calculating Display Transfer Characteristics(PDF) (Report). BBC. p. 1.
  9. ^NumFocus Colour Science (2015): "The Importance of Terminology and sRGB Uncertainty". Online document at www.colour-science.org, dated 2015-12-05. Accessed on 2024-12-17 (archived).
  10. ^abcdef"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. Replaces the version IEC 61966-2-1:1999, introducing the sYCC encoding forYCbCr color spaces, an extended-gamut RGB encoding bg-sRGB, and aCIELAB transformation.
  11. ^abDaniele Siragusano (2020): "Colour Online: sRGB... We Need To Talk". YouTube video of talk (2020-07-17, 57 min) discussing mismatch between sRGB and actual monitor transfer functions. Posted in channel @FilmLight. Accessed on 2024-12-17.
  12. ^Jason Summers (2012): "A close look at the sRGB formula". Online document at entropymine.com. Accessed on 2014-12-17 (archived)
  13. ^Jon Y. Hardeberg (2001).Acquisition and Reproduction of Color Images: Colorimetric and Multispectral Approaches. Universal-Publishers.com.ISBN 1-58112-135-0.
  14. ^Phil Green & Lindsay W. MacDonald (2002).Colour Engineering: Achieving Device Independent Colour. John Wiley and Sons.ISBN 0-471-48688-4.
  15. ^Conversion matrices for RGB vs. XYZ conversion by Bruce Justin Lindbloom
  16. ^abInternational Color Consortium (2015): "How to interpret the sRGB color space (specified in IEC 61966-2-1) for ICC profiles". Online document at www.color.org. Accessed on 2024-12-17 (archived)
  17. ^Rodney, Andrew (2005).Color Management for Photographers. Focal Press. p. 121.ISBN 978-0-240-80649-5.
  18. ^"Why Calibrate Monitor to D65 When Light Booth is D50".X-Rite. Retrieved2022-09-11.
  19. ^abInternational Color Consortium (undated): "sRGB" Summary page at color.org. Accessed on 2014-12-17 (archiving failed).
  20. ^Even if uncalibrated, it is likely they match sRGB more closely than any other popular color space
  21. ^"EXT_texture_sRGB". 24 January 2007. Retrieved12 May 2020.
  22. ^"EXT_framebuffer_sRGB". 17 September 2010. Retrieved12 May 2020.
  23. ^"GPU Gems 3: Chapter 24. The Importance of Being Linear, section 24.4.1". NVIDIA Corporation. Retrieved3 March 2017.
  24. ^abInternational Color Consortium (undated): "sRGB profiles". Summary page at color.org. Accessed on 2014-12-17 (archiving failed).
  25. ^"Is your system ICC Version 4 ready?".www.color.org. Retrieved2024-12-21.
  26. ^Will the Real sRGB Profile Please Stand Up? by Elle Stone. Analyzes the inconsistency among sRGB ICC profiles
  27. ^"Android lock screen bug and ICC profiles".color.org. Retrieved2024-12-25.
  28. ^Developers, Colour (2019-10-25)."sRGB EOTF: Pure Gamma 2.2 Function or Piece-Wise Function?".Colour Science. Retrieved2024-12-25.

External links

[edit]
CAM
CIE
RGB
Y′UV
Other
Color systems
and standards
For the vision capacities of organisms or machines, see Color vision.
Retrieved from "https://en.wikipedia.org/w/index.php?title=SRGB&oldid=1280486371"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp