对单张图像进行图像对比度增强:
from PIL import Image
from PIL import ImageEnhance
img = Image.open('./0h/FGF2.tif')
img.show()
#对比度增强
enh_con = ImageEnhance.Contrast(img)
contrast = 1.5
img_contrasted = enh_con.enhance(contrast)
img_contrasted.show()
img_contrasted.save("./0h/FGF2-new.tif")
图像对比度增强实践
本文介绍了一种使用Python中的PIL库对单张图像进行对比度增强的方法。通过调整对比度参数,实现了图像细节的清晰展示。代码示例展示了从加载图像到增强对比度并保存新图像的全过程。
918

被折叠的 条评论
为什么被折叠?



