Difference between Black and White and Grayscale image? OpenCV
In this post, we’ll discuss the difference between Black and White and Grayscale Images in OpenCV.
Black and White and Grayscale are nothing but two different color models used in Digital Image Processing.
Black and White image as the name suggests is an image where each pixel can be either black or white and nothing else. Perfect example of a Black and White image would be of a chess board where each square represents one pixel.
Grayscale images on the other hand are images where each pixel can take up any color from the chart given below. The color gradually moves from White to Black unlike in Black and White images.
You can get a better understanding of the concept if you try to think it in terms of the depth of an image.
Depth of an image is nothing but the size of each pixel in an image.
For example if I say I have a 1-bit image, it mean that each pixel value can only hold 1 bit numbers i.e either 0 or 1 (It is not hard to see that Black and White images can be treated as 1-bit images, 0 for White and 1 for Black).
Now as the we go on increasing the depth (pixel capacity) of the images, we are able to store more information in terms of the number of distinct colors. Like in a 2 bit image, each pixel can store 2 bit numbers and can thus have 4 different values (00), (01), (10) and (11).
So, Black and White images are 1-bit images and images with depth (pixel capacity) more that 1 can be classified as Grayscale images (Because they can store colors other than Black and White).