You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
743 B
Python
25 lines
743 B
Python
|
|
from PIL import Image, ImageEnhance, ImageFilter
|
|
|
|
# 打开图像文件
|
|
image_path = r'E:\SadTalker\examples\source_image\91a54181-568f-4cda-8f3c-0f2c811eaf20.jpg'
|
|
image = Image.open(image_path)
|
|
|
|
# 创建ImageEnhance.Color对象
|
|
color_enhancer = ImageEnhance.Color(image)
|
|
|
|
# 增加颜色饱和度(这将给图像添加血色)
|
|
# 注意:这个值需要根据你的图像进行调整
|
|
saturation_factor = 1.5 # 增加50%的饱和度
|
|
color_enhancer = ImageEnhance.Color(image)
|
|
color_image = color_enhancer.enhance(saturation_factor)
|
|
|
|
# 应用高斯模糊,以平滑颜色变化
|
|
blurred_image = color_image.filter(ImageFilter.GaussianBlur(1))
|
|
|
|
# 显示图像
|
|
blurred_image.show()
|
|
|
|
# 保存图像
|
|
blurred_image.save('path_to_save_image.jpg')
|