The RGB image is a combination of RED, BLUE and GREEN colors. A gray-scale image is composed of different shades of grey color. A true color image can be converted to a gray scale image by preserving the luminance (brightness) of the image.
The RGB image is 3 dimensional. In an image, at a particular position say ( i,j) Image(i,j,1) gives the value of RED pixel. Image(i,j,2) gives the value of BLUE pixel. Image(i,j,3) gives the value of GREEN pixel. The combination of these primary colors are normalized with R+G+B=1; this gives the neutral white color. The grayscale image is obtained from the RGB image by combining 30% of RED, 60% of GREEN, and 11% of BLUE. This gives the brightness information of the image. The resulting image will be two dimensional. The value 0 represents black and the value 255 represents white. The range will be between black and white values.
Function | Meaning | Examples |
---|---|---|
rgba2rgb() | Converts RGBA imagery file to RGB imagery file | rgba2rgb(Input_1) |
rgb2rgba() | Converts RGB imagery file to RGBA imagery file | rgb2rgba(Input_1,255) |
hsi2rgb() | Converts HSI imagery file to RGB imagery file | hsi2rgb(hue(Input_1[1],Input_1[2],Input_1[3]),saturation(Input_1[1],Input_1[2],Input_1[3]),intensity(Input_1[1],Input_1[2],Input_1[3])/2) |
hue() |
Extracts hue band values from HSI imagery file |
hue(Input_1 [1], Input_1 [2], Input_1 [3]) |
saturation() | Extracts saturation band values from HSI imagery file | saturation(Input_1 [1], Input_1 [2], Input_1 [3]) |
intensity() |
Extracts intensity band values from HSI imagery file |
intensity(Input_1 [1], Input_1 [2], Input_1 [3]) |
red() | Extracts Red band values from RGBA or RGB imagery file | rgb(red(Input_1),0,0) |
green() | Extracts green band values from RGBA or RGB imagery file | rgb(0,green(Input_1),0) |
blue() | Extracts blue band values from RGBA or RGB imagery file | rgb(0,0,(blue(Input_1))) |
alpha() | Extracts alpha band values from RGBA or RGB imagery file | rgba(0,0,0, (alpha(Input_1))) |