Prerequisite – RGB image representation
A colored image can be represented as a 3 order matrix. The first order is for the rows, the second order is for the columns and the third order is for specifying the color of the corresponding pixel. Here we use the RGB color format, so the third order will take 3 values of Red, Green ans Blue respectively. The values of the rows and columns depends on the size of the image.
- Load the image into a variable J by using imread().
- Store the number of rows and columns of the image in variables, r and c.
- Create 3 zero matrices R, G and B (one for each of the 3 colors) of size rXc.
- Store the corresponding color plane of the image in the corresponding zero matrix.
1: Red 2: Green 3: Blue
- Display the images by using imshow(), but typecast them into uint8 first.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Image Processing in Java | Set 5 (Colored to Red Green Blue Image Conversion)
- Extract bit planes from an Image in Matlab
- MATLAB | Display histogram of a grayscale Image
- Node Jimp | Color blue
- Node Jimp | Color | green
- MATLAB | RGB image to grayscale image conversion
- MATLAB | Converting a Grayscale Image to Binary Image using Thresholding
- Node Jimp | Color red
- Virtualization to Promote Green Computing
- Image Processing in MATLAB | Fundamental Operations
- MATLAB | RGB image representation
- MATLAB | Complement colors in a Binary image
- MATLAB | Complement colors in RGB Image
- MATLAB | Complement colors in a Grayscale Image
- LSB based Image steganography using MATLAB
- Image Complement in Matlab
- Image Resizing in Matlab
- Flip image across Secondary Diagonal in MATLAB
- Matlab | Edge Detection of an image without using in-built function
- Matlab | Erosion of an Image
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.