8

与 matplotlib.imshow() 相比,似乎 matplotlib.imsave() 会使图像变亮。例如,看下面的代码。

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)

保存的图像“image_new.jpg”(右)比“image.jpg”(左)略亮

图像.jpg image_new.jpg

图片来源: https ://c1.staticflickr.com/9/8191/8424182610_e23dcc6b4d_b.jpg

4

0 回答 0