# convert RGB to YCbCr

Asked by Aseel H on 7 Jul 2012
Latest activity Answered by Image Analyst on 8 Jul 2012

I need to get three channel(three matrix)= Y, Cb, Cr from convert color imag to ycbcr but: the follow function

RGB = imread(colorimage) ycbcr = rgb2ycbcr(RGB)

give alone one channel(luminance)

## 5 Comments

Anton Semechko on 7 Jul 2012
```Y=YCBCR(:,:,1);
Cb=YCBCR(:,:,2);
Cr=YCBCR(:,:,3);
```
Aseel H on 7 Jul 2012

thanks, Anton

Aseel H on 8 Jul 2012

can you tell me, how convert RGB to YCbCr integer to integer rgb2ycbcr() give float values.

## Products

No products are associated with this question.

## 1 Answer

Answer by Image Analyst on 8 Jul 2012
Edited by Walter Roberson on 8 Jul 2012
Accepted answer

Does the information in the Help help you:

```YCBCR = rgb2ycbcr(RGB) converts the truecolor image RGB to the equivalent image in the YCbCr color space. RGB must be a M-by-N-by-3 array.
```
```If the input is uint8, YCBCR is uint8, where Y is in the range [16 235], and Cb and Cr are in the range [16 240]. If the input is a double, Y is in the range [16/255 235/255] and Cb and Cr are in the range [16/255 240/255]. If the input is uint16, Y is in the range [4112 60395] and Cb and Cr are in the range [4112 61680].
```

Contact us