Skip to content

Commit dfdca3b

Browse files
committed
提交代码
1 parent 89708c6 commit dfdca3b

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

xianhuan/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Python技术 公众号文章代码库
1010

1111
## 实例代码
1212

13+
[Python美图技术也就几行代码!](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/imageenhange):Python美图技术也就几行代码!
14+
1315
[几行代码,实现Python捕获、播放和保存摄像头视频!](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/videobase):几行代码,实现Python捕获、播放和保存摄像头视频!
1416

1517
[几行代码迅速提取音频,YYDS!](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/extractaudio):几行代码迅速提取音频,YYDS!

xianhuan/imageenhance/imgeenhance.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
@author: 闲欢
5+
"""
6+
from PIL import ImageEnhance, Image
7+
#-*- coding: UTF-8 -*-
8+
9+
from PIL import Image
10+
from PIL import ImageEnhance
11+
12+
#原始图像
13+
image = Image.open('girl.jpeg')
14+
image.show()
15+
16+
#亮度增强
17+
enh_bri = ImageEnhance.Brightness(image)
18+
brightness = 4
19+
image_brightened = enh_bri.enhance(brightness)
20+
image_brightened.show()
21+
22+
#色度增强
23+
enh_col = ImageEnhance.Color(image)
24+
color = 4
25+
image_colored = enh_col.enhance(color)
26+
image_colored.show()
27+
28+
#对比度增强
29+
enh_con = ImageEnhance.Contrast(image)
30+
contrast = 4
31+
image_contrasted = enh_con.enhance(contrast)
32+
image_contrasted.show()
33+
34+
#锐度增强
35+
enh_sha = ImageEnhance.Sharpness(image)
36+
sharpness = 4
37+
image_sharped = enh_sha.enhance(sharpness)
38+
image_sharped.show()

0 commit comments

Comments
 (0)