-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.image - Copy.py
63 lines (48 loc) · 1.5 KB
/
edit.image - Copy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# installation of pillow library
# change the image extension
# resize image files
# resize multiple images using for loop
# Sharpness
# Brightess
# Color
# Contrast
# Image blur , GaussianBlur
from PIL import Image, ImageEnhance, ImageFilter
import os
# img1.save('dog1.pdf')
# img1.show()
# 250
# MAX_SIZE = (250,250)
# img1.thumbnail(MAX_SIZE)
# img1.save('dog1small.jpg')
# for item in os.listdir():
# if item.endswith('.jpg'):
# img1 = Image.open(item)
# filename,extension = os.path.splitext(item)
# img1.save(f'{filename}.png')
# img1 = Image.open('dog1.jpg')
# enhancer = ImageEnhance.Sharpness(img1)
# enhancer.enhance(5).save('dog1edited.jpg')
# 0 : blurry
# 1: original image
# 2 : image with increased sharpness
# -------color ---------
# img1 = Image.open('dog1.jpg')
# enhancer = ImageEnhance.Color(img1)
# enhancer.enhance(2).save('dog1edited.jpg')
# --------brightness -----------
# img1 = Image.open('dog1.jpg')
# enhancer = ImageEnhance.Brightness(img1)
# enhancer.enhance(1.5).save('dog1edited.jpg')
img1 = Image.open('dog1.jpg')
enhancer = ImageEnhance.Contrast(img1)
enhancer.enhance(1.5).save('dog1edited.jpg')
# image blur
# img1.filter(ImageFilter.GaussianBlur(radius=4)).save('dog1edited.jpg')
# from PIL import Image,ImageFilter, ImageEnhance
# image = Image.open('cute.jpg')
# image.filter(ImageFilter.MaxFilter(size=0)).show()
# # enhancer = ImageEnhance.Brightness(image)
# # enhancer.enhance(4).show()
# pillowmodule.py
# Displaying pillowmodule.py.