Function File: YCbCrmap = rgb2ycbcr (cmap)
Function File: YCbCr = rgb2ycbcr (RGB)
Function File: … = rgb2ycbcr (…, [Kb Kr])
Function File: … = rgb2ycbcr (…, standard)

Convert RGB values to YCbCr.

The conversion changes the image RGB or colormap cmap, from the RGB color model to YCbCr (luminance, chrominance blue, and chrominance red). RGB must be of class double, single, uint8, or uint16.

The formula used for the conversion is dependent on two constants, Kb and Kr which can be specified individually, or according to existing standards:

"601" (default)

According to the ITU-R BT.601 (formerly CCIR 601) standard. Its values of Kb and Kr are 0.114 and 0.299 respectively.

"709"

According to the ITU-R BT.709 standard. Its values of Kb and Kr are 0.0722 and 0.2116 respectively.

"2020"

According to the ITU-R BT.2020 standard. Its values of Kb and Kr are 0.0593 and 0.2627 respectively.

See also: hsv2rgb, ntsc2rgb, rgb2hsv, rgb2ntsc.

Package: image