File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ Python技术 公众号文章代码库
10
10
11
11
## 实例代码
12
12
13
+ [ Python美图技术也就几行代码!] ( https://github.com/JustDoPython/python-examples/tree/master/xianhuan/imageenhange ) :Python美图技术也就几行代码!
14
+
13
15
[ 几行代码,实现Python捕获、播放和保存摄像头视频!] ( https://github.com/JustDoPython/python-examples/tree/master/xianhuan/videobase ) :几行代码,实现Python捕获、播放和保存摄像头视频!
14
16
15
17
[ 几行代码迅速提取音频,YYDS!] ( https://github.com/JustDoPython/python-examples/tree/master/xianhuan/extractaudio ) :几行代码迅速提取音频,YYDS!
Original file line number Diff line number Diff line change
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 ()
You can’t perform that action at this time.
0 commit comments