skimage在均衡图像时添加了熵,在保存图像时改变了直方图,如何保存均衡后的图像?

when equalizing images, skimage adds entropy and changes histogram when saving the images, how to preserve the equalized image?

我得到了以下图片:

我正在做以下事情

为了能够保存均衡图像,我还需要在我的过程中添加什么?

问题在于我使用的是 JPGJPG使用有损压缩来保存图像,在图像中加入噪声影响均衡并增加图像熵。

为了解决这个问题,我尝试了 PNG 这是一种用于存储图像的无损压缩格式。代码是:

img = skimage.io.imread('original.jpg')
hist_equalized_img = skimage.exposure.equalize_hist(img)
skimage.io.imsave(fname = 'he.png', arr= hist_equalized_img)