写在最前面:
只是对图像的一点点处理,效果只能说一般吧。
原始图片:
对比度增强:
from PIL import Image,ImageEnhance
# 打开图片
im = Image.open('1.jpg','r')
# 对比度增强
enh_con = ImageEnhance.Contrast(im)
contrast = 10
image_contrasted = enh_con.enhance(contrast)
image_contrasted.show()
锐度增强:
from PIL import Image,ImageEnhance
# 打开图片
im = Image.open('1.jpg','r')
im.show()
# 锐度增强
enh_sha = ImageEnhance.Sharpness(im)
sharpness = 10.0
image_sharped = enh_sha.enhance(sharpness)
image_sharped.show()
色度增强:
from PIL import Image,ImageEnhance
# 打开图片
im = Image.open('1.jpg','r')
im.show()
# 色度增强
enh_col = ImageEnhance.Color(im)
color = 10
image_colored = enh_col.enhance(color)
image_colored.show()
亮度增强:
from PIL import Image,ImageEnhance
# 打开图片
im = Image.open('1.jpg','r')
im.show()
# 亮度增强
enh_bri = ImageEnhance.Brightness(im)
brightness = 10
image_brightened = enh_bri.enhance(brightness)
image_brightened.show()