How to separate an image to rgb?
Show older comments
how to divide an image into its r,g,and b colour planes,
Accepted Answer
More Answers (3)
Sailesh Sidhwani
on 25 Oct 2018
Edited: Sailesh Sidhwani
on 29 Jul 2019
2 votes
Starting R2018b, Image Processing Toolbox has a new function "imsplit" which does exactly this: https://www.mathworks.com/help/images/ref/imsplit.html
ES
on 31 Dec 2013
I=imread('image.jpg')
will give I (a 3d array, of size [x,y,3] )where x and y are the dimensions of the image. 3 is for R, G, and B components.
To separate out the three components, you can do a
R = reshape(I(:,:,1),[],1);
G = reshape(I(:,:,2),[],1);
B = reshape(I(:,:,3),[],1);
Negesse Tadesse
on 29 Jul 2019
Edited: DGM
on 12 Feb 2023
how about imsplit function?
[R G B] = imsplit(myImage);
Categories
Find more on Christmas / Winter in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!