Implementing Convolution, Understanding Filters

when i provided an rgb image as parameter, even if the plt.imshow function had cmap=gray, the image turned out an rgb image only. but in cas of gray scale image , it was gray, so my point is why was the output as rgb image even if plt . imshow had cmap=gray as parameter?

Hey,
You are giving 3 colors red green and blue. and telling it to plot grayscale image. It won’t be able to plot grayscale, Since it has recognised the image as colored image therefore grayscale mapping is not possible here.
Even though you give grayscale image plt tries to give it a color, In that case you can say Hey I’ve provided you a grayscale image, Show me the image in the grayscale mode.
But providing rgb image and asking for grayscale value, It will ignore this parameter.
I hope this basic difference is clear to you now.
Thanks :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.