Python Imaging Library: ImageEnhance Module(图像增强模块

2019-04-15 16:04发布

Python Imaging Library: ImageEnhance Module(图像增强模块) # 图像增强模块(ImageEnhance Module)
PilImg_Enhance = Image.open('图像5.jpg')


# 颜 {MOD}增强
# ImageEnhance.Color(image) ⇒ Color enhancer instance
PilImg_Color = ImageEnhance.Color(PilImg_Enhance)
# for i in range(5):
#    factor = i * 4.0
#    PilImg_Color.enhance(factor).show("Color %f" % factor)


# 亮度增强
# ImageEnhance.Brightness(image) ⇒ Brightness enhancer instance
# PilImg_Brightness = ImageEnhance.Brightness(PilImg_Enhance)
# for i in range(5):
#    factor = i * 2.0
#    PilImg_Brightness.enhance(factor).show("Brightness %f" % factor)


# 对比度增强
# ImageEnhance.Contrast(image) ⇒ Contrast enhancer instance
# PilImg_Contrast = ImageEnhance.Contrast(PilImg_Enhance)
# for i in range(5):
#    factor = i * 2.0
#    PilImg_Contrast.enhance(factor).show("Contrast %f" % factor)


# 锐度增强
# ImageEnhance.Sharpness(image) ⇒ Sharpness enhancer instance
# PilImg_Sharpness = ImageEnhance.Sharpness(PilImg_Enhance)
# for i in range(5):
#    factor = i * 4.0
#    PilImg_Sharpness.enhance(factor).show("Sharpness %f" % factor)