RGB image display in Matplotlib: plt.imshow returns a blue image [duplicate]

You are facing this issue since you are reading the image with opencv and opencv reads and displays an image as BGR format instead of RGB color format. Whereas matplotlib uses RGB color format to display image.
Try using:

image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

pixels = np.array(image)

plt.imshow(pixels)
plt.show()

Leave a Comment

tech