YCbCr
Encyclopedia
YCbCr or Y′CbCr, sometimes written or , is a family of color space
s 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′ (with prime) is distinguished from Y which is luminance, meaning that light intensity is non-linearly encoded using gamma correction
.
Y′CbCr is not an absolute color space
, it is a way of encoding RGB information. The actual color displayed depends on the actual RGB primaries used to display the signal. Therefore a value expressed as Y′CbCr is predictable only if standard RGB primary chromaticities are used.
displays are driven by red, green, and blue voltage signals, but these RGB
signals are not efficient as a representation for storage and transmission, since they have a lot of redundancy
.
YCbCr and Y′CbCr are a practical approximation to color processing and perceptual uniformity, where the primary color
s corresponding roughly to red, green and blue are processed into perceptually meaningful information. By doing this, subsequent image/video processing, transmission and storage can do operations and introduce errors in perceptually meaningful ways. Y′CbCr is used to separate out a luma signal (Y′) that can be stored with high resolution or transmitted at high bandwidth, and two chroma components (CB and CR) that can be bandwidth-reduced, subsampled, compressed, or otherwise treated separately for improved system efficiency.
One practical example would be decreasing the bandwidth or resolution allocated to "color" compared to "black and white", since humans are more sensitive to the black-and-white information (see image example to the right).
when used for analog
component video, although the term Y′CbCr is commonly used for both systems, with or without the prime.
Y′CbCr is often confused with the YUV
color space, and typically the terms YCbCr and YUV are used interchangeably, leading to some confusion; when referring to signals in video or digital form, the term "YUV" mostly means "Y′CbCr".
Y′CbCr signals (prior to scaling and offsets to place the signals into digital form) are called YPbPr
, and are created from the corresponding gamma-adjusted RGB (red, green and blue) source using two defined constants KB and KR as follows:
where KB and KR are ordinarily derived from the definition of the corresponding RGB space. (The equivalent matrix
manipulation is often referred to as the "color matrix".)
Here, the prime ′ symbols mean gamma correction
is being used; thus R′, G′ and B′ nominally range from 0 to 1, with 0 representing the minimum intensity (e.g., for display of the color black
) and 1 the maximum (e.g., for display of the color white
). The resulting luma (Y) value will then have a nominal range from 0 to 1, and the chroma (PB and PR) values will have a nominal range from -0.5 to +0.5. The reverse conversion process can be readily derived by inverting the above equations.
When representing the signals in digital form, the results are scaled and rounded, and offsets are typically added. For example, the scaling and offset applied to the Y′ component per specification (e.g. MPEG-2
) results in the value of 16 for black and the value of 235 for white when using an 8-bit representation. The standard has 8-bit digitized versions of CB and CR scaled to a different range of 16 to 240. Consequently, rescaling by the fraction (235-16)/(240-16) = 219/224 is sometimes required when doing color matrixing or processing in YCbCr space, resulting in quantization distortions when the subsequent processing is not performed using higher bit depths.
The scaling that results in the use of a smaller range of digital values than what might appear to be desirable for representation of the nominal range of the input data allows for some "overshoot" and "undershoot" during processing without necessitating undesirable clipping
. This "head-room" and "toe-room" can also be used for extension of the nominal color gamut
, as specified by xvYCC
.
Since the equations defining YCbCr are formed in a way that rotates the entire nominal RGB color cube and scales it to fit within a (larger) YCbCr color cube, there are some points within the YCbCr color cube that cannot be represented in the corresponding RGB domain (at least not within the nominal RGB range). This causes some difficulty in determining how to correctly interpret and display some YCbCr signals. These out-of-range YCbCr values are used by xvYCC
to encode colors outside the BT.709 gamut.
use in the ITU-R
BT.601 (formerly CCIR 601
) standard for use with digital component video
is derived from the corresponding RGB space as follows:
From the above constants and formulas, the following can be derived for ITU-R BT.601. Analog YPbPr from analog R'G'B' is derived as follows:
Digital Y′CbCr (8 bits per sample) is derived from analog R'G'B' as follows:
or simply componentwise
The resultant signals range from 16 to 235; the values from 0 to 15 are called footroom, while the values from 236 to 255 are called headroom.
Alternatively, digital Y′CbCr is derived from digital R'dG'dB'd (8 bits per sample) according to the following equations:
All values are multiplied by . This allows for the value 256 in the denominator, which can be calculated by a single bitshift.
The inverse transform is:
The inverse transform without any roundings (using values coming directly from ITU-R BT.601 recommendation) is:
This form of Y′CbCr is used primarily for older standard-definition television
systems, as it uses an RGB model that fits the phosphor emission characteristics of older CRT
s.
standard, primarily for HDTV
use. The newer form is also used in some computer-display oriented applications. In this case, the values of Kb and Kr differ, but the formulas for using them are the same. For ITU-R BT.709, the constants are:
This form of Y′CbCr is based on an RGB model that more closely fits the phosphor emission characteristics of newer CRTs and other modern display equipment.
The definitions of the R', G', and B' signals also differ between BT.709 and BT.601, and differ within BT.601 depending on the type of TV system in use (625-line as in PAL
and SECAM
or 525-line as in NTSC
), and differ further in other specifications. In different designs there are differences in the definitions of the R, G, and B chromaticity coordinates, the reference white point, the supported gamut range, the exact gamma pre-compensation functions for deriving R', G' and B' from R, G, and B, and in the scaling and offsets to be applied during conversion from R'G'B' to Y′CbCr. So proper conversion of Y′CbCr from one form to the other is not just a matter of inverting one matrix and applying the other. In fact, when Y′CbCr is designed ideally, the values of KB and KR are derived from the precise specification of the RGB color primary signals, so that the luma (Y′) signal corresponds as closely as possible to a gamma-adjusted
measurement of luminance
(typically based on the CIE
1931 measurements of the response of the human visual system to color stimuli).
allows Y′CbCr where Y′, CB and CR have the full 8-bit range of 0-255:
Color space
A color model is an abstract mathematical model describing the way colors can be represented as tuples of numbers, typically as three or four values or color components...
s used as a part of the color image pipeline
Color image pipeline
An image pipeline or video pipeline is a term used to describe the components that are typically or commonly used between an image source , and an image renderer , or for performing any intermediate digital image processing...
in video
Video
Video is the technology of electronically capturing, recording, processing, storing, transmitting, and reconstructing a sequence of still images representing scenes in motion.- History :...
and digital photography
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...
systems. Y′ is the luma
Luma (video)
In video, luma, sometimes called luminance, represents the brightness in an image . Luma is typically paired with chrominance. Luma represents the achromatic image without any color, while the chroma components represent the color information...
component and CB and CR are the blue-difference and red-difference chroma
Chrominance
Chrominance is the signal used in video systems to convey the color information of the picture, separately from the accompanying luma signal . Chrominance is usually represented as two color-difference components: U = B' − Y' and V = R' − Y'...
components. Y′ (with prime) is distinguished from Y which is luminance, meaning that light intensity is non-linearly encoded using gamma correction
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...
.
Y′CbCr is not an absolute color space
Absolute color space
In color science, there are two meanings of the term absolute color space:* A color space in which the perceptual difference between colors is directly related to distances between colors as represented by points in the color space....
, it is a way of encoding RGB information. The actual color displayed depends on the actual RGB primaries used to display the signal. Therefore a value expressed as Y′CbCr is predictable only if standard RGB primary chromaticities are used.
Rationale
Cathode ray tubeCathode 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...
displays are driven by red, green, and blue voltage signals, but these RGB
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...
signals are not efficient as a representation for storage and transmission, since they have a lot of redundancy
Redundancy (information theory)
Redundancy in information theory is the number of bits used to transmit a message minus the number of bits of actual information in the message. Informally, it is the amount of wasted "space" used to transmit certain data...
.
YCbCr and Y′CbCr are a practical approximation to color processing and perceptual uniformity, where the primary color
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....
s corresponding roughly to red, green and blue are processed into perceptually meaningful information. By doing this, subsequent image/video processing, transmission and storage can do operations and introduce errors in perceptually meaningful ways. Y′CbCr is used to separate out a luma signal (Y′) that can be stored with high resolution or transmitted at high bandwidth, and two chroma components (CB and CR) that can be bandwidth-reduced, subsampled, compressed, or otherwise treated separately for improved system efficiency.
One practical example would be decreasing the bandwidth or resolution allocated to "color" compared to "black and white", since humans are more sensitive to the black-and-white information (see image example to the right).
Name
YCbCr is sometimes abbreviated to YCC. Y′CbCr is often called YPbPrYPbPr
' is a color space used in video electronics, in particular in reference to component video cables. is the analog version of the YCBCR color space; the two are numerically equivalent, but YPBPR is designed for use in analog systems whereas YCBCR is intended for digital video. cables are also...
when used for analog
Analog video
Analog video is a video signal transferred by an analog signal. An analog color video signal contains luminance, brightness and chrominance of an analog television image...
component video, although the term Y′CbCr is commonly used for both systems, with or without the prime.
Y′CbCr is often confused with the YUV
YUV
YUV is a color space typically used as part of a color image pipeline. It encodes a color image or video taking human perception into account, allowing reduced bandwidth for chrominance components, thereby typically enabling transmission errors or compression artifacts to be more efficiently...
color space, and typically the terms YCbCr and YUV are used interchangeably, leading to some confusion; when referring to signals in video or digital form, the term "YUV" mostly means "Y′CbCr".
Y′CbCr signals (prior to scaling and offsets to place the signals into digital form) are called YPbPr
YPbPr
' is a color space used in video electronics, in particular in reference to component video cables. is the analog version of the YCBCR color space; the two are numerically equivalent, but YPBPR is designed for use in analog systems whereas YCBCR is intended for digital video. cables are also...
, and are created from the corresponding gamma-adjusted RGB (red, green and blue) source using two defined constants KB and KR as follows:
where KB and KR are ordinarily derived from the definition of the corresponding RGB space. (The equivalent matrix
Matrix (mathematics)
In mathematics, a matrix is a rectangular array of numbers, symbols, or expressions. The individual items in a matrix are called its elements or entries. An example of a matrix with six elements isMatrices of the same size can be added or subtracted element by element...
manipulation is often referred to as the "color matrix".)
Here, the prime ′ symbols mean gamma correction
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...
is being used; thus R′, G′ and B′ nominally range from 0 to 1, with 0 representing the minimum intensity (e.g., for display of the color black
Black
Black is the color of objects that do not emit or reflect light in any part of the visible spectrum; they absorb all such frequencies of light...
) and 1 the maximum (e.g., for display of the color white
White
White is a color, the perception of which is evoked by light that stimulates all three types of color sensitive cone cells in the human eye in nearly equal amounts and with high brightness compared to the surroundings. A white visual stimulation will be void of hue and grayness.White light can be...
). The resulting luma (Y) value will then have a nominal range from 0 to 1, and the chroma (PB and PR) values will have a nominal range from -0.5 to +0.5. The reverse conversion process can be readily derived by inverting the above equations.
When representing the signals in digital form, the results are scaled and rounded, and offsets are typically added. For example, the scaling and offset applied to the Y′ component per specification (e.g. MPEG-2
MPEG-2
MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission...
) results in the value of 16 for black and the value of 235 for white when using an 8-bit representation. The standard has 8-bit digitized versions of CB and CR scaled to a different range of 16 to 240. Consequently, rescaling by the fraction (235-16)/(240-16) = 219/224 is sometimes required when doing color matrixing or processing in YCbCr space, resulting in quantization distortions when the subsequent processing is not performed using higher bit depths.
The scaling that results in the use of a smaller range of digital values than what might appear to be desirable for representation of the nominal range of the input data allows for some "overshoot" and "undershoot" during processing without necessitating undesirable clipping
Clipping (signal processing)
Clipping is a form of distortion that limits a signal once it exceeds a threshold. Clipping may occur when a signal is recorded by a sensor that has constraints on the range of data it can measure, it can occur when a signal is digitized, or it can occur any other time an analog or digital signal...
. This "head-room" and "toe-room" can also be used for extension of the nominal color 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...
, as specified by xvYCC
XvYCC
xvYCC or Extended-gamut YCC 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...
.
Since the equations defining YCbCr are formed in a way that rotates the entire nominal RGB color cube and scales it to fit within a (larger) YCbCr color cube, there are some points within the YCbCr color cube that cannot be represented in the corresponding RGB domain (at least not within the nominal RGB range). This causes some difficulty in determining how to correctly interpret and display some YCbCr signals. These out-of-range YCbCr values are used by xvYCC
XvYCC
xvYCC or Extended-gamut YCC 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...
to encode colors outside the BT.709 gamut.
ITU-R BT.601 conversion
The form of Y′CbCr that was defined for standard-definition televisionStandard-definition television
Sorete-definition television is a television system that uses a resolution that is not considered to be either enhanced-definition television or high-definition television . The term is usually used in reference to digital television, in particular when broadcasting at the same resolution as...
use in the ITU-R
ITU-R
The ITU Radiocommunication Sector is one of the three sectors of the International Telecommunication Union and is responsible for radio communication....
BT.601 (formerly CCIR 601
CCIR 601
ITU-R Recommendation BT.601, more commonly known by the abbreviations Rec. 601 or BT.601 is a standard published in 1982 by International Telecommunication Union - Radiocommunications sector for encoding interlaced analog video signals in digital video form...
) standard for use with digital component video
Component video
Component video is a video signal that has been split into two or more component channels. In popular use, it refers to a type of component analog video information that is transmitted or stored as three separate signals...
is derived from the corresponding RGB space as follows:
From the above constants and formulas, the following can be derived for ITU-R BT.601. Analog YPbPr from analog R'G'B' is derived as follows:
Digital Y′CbCr (8 bits per sample) is derived from analog R'G'B' as follows:
or simply componentwise
The resultant signals range from 16 to 235; the values from 0 to 15 are called footroom, while the values from 236 to 255 are called headroom.
Alternatively, digital Y′CbCr is derived from digital R'dG'dB'd (8 bits per sample) according to the following equations:
All values are multiplied by . This allows for the value 256 in the denominator, which can be calculated by a single bitshift.
The inverse transform is:
The inverse transform without any roundings (using values coming directly from ITU-R BT.601 recommendation) is:
This form of Y′CbCr is used primarily for older standard-definition television
Standard-definition television
Sorete-definition television is a television system that uses a resolution that is not considered to be either enhanced-definition television or high-definition television . The term is usually used in reference to digital television, in particular when broadcasting at the same resolution as...
systems, as it uses an RGB model that fits the phosphor emission characteristics of older CRT
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...
s.
ITU-R BT.709 conversion
A different form of Y′CbCr is specified in the ITU-R BT.709Rec. 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....
standard, primarily for HDTV
High-definition television
High-definition television is video that has resolution substantially higher than that of traditional television systems . HDTV has one or two million pixels per frame, roughly five times that of SD...
use. The newer form is also used in some computer-display oriented applications. In this case, the values of Kb and Kr differ, but the formulas for using them are the same. For ITU-R BT.709, the constants are:
This form of Y′CbCr is based on an RGB model that more closely fits the phosphor emission characteristics of newer CRTs and other modern display equipment.
The definitions of the R', G', and B' signals also differ between BT.709 and BT.601, and differ within BT.601 depending on the type of TV system in use (625-line as in PAL
PAL
PAL, short for Phase Alternating Line, is an analogue television colour encoding system used in broadcast television systems in many countries. Other common analogue television systems are NTSC and SECAM. This page primarily discusses the PAL colour encoding system...
and SECAM
SECAM
SECAM, also written SÉCAM , is an analog color television system first used in France....
or 525-line as in NTSC
NTSC
NTSC, named for the National Television System Committee, is the analog television system that is used in most of North America, most of South America , Burma, South Korea, Taiwan, Japan, the Philippines, and some Pacific island nations and territories .Most countries using the NTSC standard, as...
), and differ further in other specifications. In different designs there are differences in the definitions of the R, G, and B chromaticity coordinates, the reference white point, the supported gamut range, the exact gamma pre-compensation functions for deriving R', G' and B' from R, G, and B, and in the scaling and offsets to be applied during conversion from R'G'B' to Y′CbCr. So proper conversion of Y′CbCr from one form to the other is not just a matter of inverting one matrix and applying the other. In fact, when Y′CbCr is designed ideally, the values of KB and KR are derived from the precise specification of the RGB color primary signals, so that the luma (Y′) signal corresponds as closely as possible to a gamma-adjusted
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...
measurement of 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...
(typically based on the CIE
International Commission on Illumination
The International Commission on Illumination is the international authority on light, illumination, color, and color spaces...
1931 measurements of the response of the human visual system to color stimuli).
JPEG conversion
JFIF usage of JPEGJPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....
allows Y′CbCr where Y′, CB and CR have the full 8-bit range of 0-255:
External links
- Charles Poynton — Color FAQ
- Charles Poynton — Video engineering
- Color Space Visualization
- PC Magazine Encyclopedia: YCbCr
- YUV, YCbCr, YPbPr color spaces.
- Color formats for image and video processing — Color conversion between RGB, YUV, YCbCr and YPbPr.