Convert RGB color values to NTSC color space
Convert Image from RGB to YIQ
This example shows how to convert an image from RGB to NTSC color space.
Read an RGB image into the workspace.
RGB = imread('board.tif');
Convert the image to YIQ color space.
YIQ = rgb2ntsc(RGB);
Display the NTSC luminance value, represented by the first color channel in the YIQ image.
imshow(YIQ(:,:,1)); title('Luminance in YIQ Color Space');
RGB — RGB color values
RGB color values to convert, specified as a numeric array in one of these formats.
c-by-3 colormap. Each row specifies one RGB color value.
YIQ — Converted YIQ color values
Converted YIQ color values, returned as a numeric array of the same size as the input.
|Y||Luma, or brightness of the image. Values are in the range [0, 1], where 0 specifies black and 1 specifies white. Colors increase in brightness as Y increases.|
|I||In-phase, which is approximately the amount of blue or orange tones in the image. I in the range [-0.5959, 0.5959], where negative numbers indicate blue tones and positive numbers indicate orange tones. As the magnitude of I increases, the saturation of the color increases.|
|Q||Quadrature, which is approximately the amount of green or purple tones in the image. Q in the range [-0.5229, 0.5229], where negative numbers indicate green tones and positive numbers indicate purple tones. As the magnitude of Q increases, the saturation of the color increases.|
In the NTSC color space, the luminance is the grayscale signal used to display
pictures on monochrome (black and white) televisions. The other components carry the hue
and saturation information. The value
0 corresponds to the absence of
the component, while the value
1 corresponds to full saturation of
rgb2ntsc defines the NTSC components using