Prerequisite: RGB image representation
A coloured 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 colour of the corresponding pixel. Here we use the RGB colour format, so the third order will take 3 values of Red, Green and Blue respectively. The values of the rows and columns depending on the size of the image.
The flag of Thailand shows five horizontal stripes in the colours red, white, blue, white and red, with the central blue stripe being twice as wide as each of the other four.
- First, we make a matrix of dimensions 600 X 800 X 3. Where the number of pixels of rows is 600, the number of pixels of columns is 800 and 3 is the colour coding in RGB format.
- Paint the first and the last strip with red. RGB is (165, 25, 49).
- Paint the middle strip with blue. RGB is (45, 44, 72).
- Paint the remaining two strips with white. RGB is (244, 245, 248).
Below is the code:
- Draw Bangladesh Flag Using Matlab
- Draw Seychelles Flag using MATLAB
- Draw Sweden Flag using matlab
- Draw Sudan Flag using MATLAB
- Draw Switzerland Flag Using Matlab
- How to draw Japan flag using MATLAB
- Draw Kuwait Flag using MATLAB
- Draw Indian Flag using matlab
- Draw Austria flag using Matlab
- Matlab | Dilation of an Image
- Reverse Video in Matlab
- Image Resizing in Matlab
- Image Complement in Matlab
- MATLAB | RGB image representation
- 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.