项目初始化
This commit is contained in:
11
utils/pillow_util.py
Normal file
11
utils/pillow_util.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from PIL import Image, ImageEnhance
|
||||
|
||||
# 加载图片
|
||||
img = Image.open("fb1df265-5085-4bc2-881b-7674b620c4ac.jpg")
|
||||
|
||||
# 增强对比度(1.5 倍为示例,你可以调节参数)
|
||||
enhancer = ImageEnhance.Contrast(img)
|
||||
img_enhanced = enhancer.enhance(4.0)
|
||||
|
||||
# 保存增强后的图像
|
||||
img_enhanced.save("enhanced_image_pillow.png")
|
Reference in New Issue
Block a user