Output of image segmentation

The output image of image segmentation had a shape of (x,y,1).the channel of the image is 1 but still the image appears to have colours…what is the reason behind it? Isn’t a single channel image black and white??

It is an interesting point, but it’s just a question of how the rendering routine works. Here is the documentation for matplotlib.pyplot.imshow.

Here’s the first full paragraph:

The input may either be actual RGB(A) data, or 2D scalar data, which will be rendered as a pseudocolor image. For displaying a grayscale image set up the colormapping using the parameters cmap='gray', vmin=0, vmax=255 .

So I guess this falls under the category of 2D scalar data. You are welcome to try playing around with different parameters like cmap = "gray" and see how that changes the behavior.