This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Convert NTSC values to RGB color space


rgbmap = ntsc2rgb(yiqmap)
RGB = ntsc2rgb(YIQ)


rgbmap = ntsc2rgb(yiqmap) converts the m-by-3 NTSC (television) color values in yiqmap to RGB color space. If yiqmap is m-by-3 and contains the NTSC luminance (Y) and chrominance (I and Q) color components as columns, then rgbmap is an m-by-3 matrix that contains the red, green, and blue values equivalent to those colors. Both rgbmap and yiqmap contain intensities in the range 0 to 1.0. The intensity 0 corresponds to the absence of the component, while the intensity 1.0 corresponds to full saturation of the component.

RGB = ntsc2rgb(YIQ) converts the NTSC image YIQ to the equivalent truecolor image RGB.

ntsc2rgb computes the RGB values from the NTSC components using

[RGB]=[1.000  0.956  0.6211.0000.2720.6471.0001.106  1.703][YIQ].

Class Support

The input image or colormap must be of class double. The output is of class double.


collapse all

This example shows how to convert an image from RGB to NTSC color space and back.

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, represented by the first color channel in the YIQ image.

title('Luminance in YIQ Color Space')

Convert the YIQ image back to RGB color space.

RGB2 = ntsc2rgb(YIQ);

Display the image that was converted from YIQ to RGB color space.

title('Image Converted from YIQ to RGB Color Space')

Introduced before R2006a