Understand the Difference Matplotlib imread between Python OpenCV imread

Both python matplotlib imread and Python opencv imread can read and show an image, what is the difference between them? This article will compare them.

Difference Matplotlib imread between Python OpenCV imread

Their difference is below:

Matplotlib imreadPython OpenCV imread
Reads color value as RGBReads color value as BGR
Lists pixel rows from the bottom to the topLists pixel rows from the top to bottom
Less efficientMore efficient
matplotlib_img=img.imread('img.jpg')
plt.imshow(matplotlib_img)
cv_img=cv2.imread('img.jpg')
plt.imshow(cv_img)

If you plan to show an image with better quality, you should use python opencv.

Understand the Difference Matplotlib imread between Python OpenCV imread