Why Matplotlib. Pyplot. Imsave() and Matplotlib. Pyplot. Imshow() Image Qualities Are Different? How to Ensure the Same Quality?

Seems matplotlib.imsave() lightens the image when compared to that of matplotlib.imshow(). For example, look at the code below.

import imageio
import matplotlib.pyplot as plt
image = imageio.imread('image.jpg')
plt.imshow(image)
plt.imsave('image_new.jpg',image )

image_new = imageio.imread('image_new.jpg')
plt.imshow(image_new)

Saved image 'image_new.jpg' (right) is slightly lighter than 'image.jpg' (left)

image_source:

10
Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article