Friday 25 January 2013

Sequence of RGB channels in Bitmap Image

It is very necessary to know what is the sequence of RGB channels in Bitmap ?As the name indicates it should be in RGB sequence means first we read red channel,after that green channel & then Blue channel But it is not true .The original sequence of RGB channels is BGR.It means we read Blue channel firstly,Green channel secondly & red channel at the last.We can verify it by taking three pure Red,Green & Blue 24-bit bitmap images.Then We need to read first three character of each of the image.We find that the value of first three character of blue image is 255,0,0 while values of first three characters of Green is 0,255,0 & values of first three character of red image is 0,0,255.Thus it is proved that the sequence of RGB channels in bitmap image is BGR.So we should be careful while using this.

Output of the program:-

No comments:

Post a Comment