-
Notifications
You must be signed in to change notification settings - Fork 0
/
Image.py
50 lines (34 loc) · 1.2 KB
/
Image.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
from PIL import Image as PImage
import Effects
class Image:
def __init__(self, path):
self.image = PImage.open(path)
self.originalPath = path
def save(self):
if self.originalPath.rsplit('/', 1)[1] != 'init.png':
self.image.save(self.originalPath)
def saveAs(self, path):
self.image.save(path)
self.originalPath = path
def rotateCW(self):
self.image = Effects.rotateRight(self.image)
def rotateCCW(self):
self.image = Effects.rotateLeft(self.image)
def verticalFlip(self):
self.image = Effects.flipVertical(self.image)
def horizontalFlip(self):
self.image = Effects.flipHorizontal(self.image)
def invert(self):
self.image = Effects.invert(self.image)
def grayscale(self):
self.image = Effects.grayScale(self.image)
def lighten(self):
self.image = Effects.lighten(self.image)
def darken(self):
self.image = Effects.darken(self.image)
def findEdges(self):
self.image = Effects.edgeDetection(self.image)
def sharpen(self):
self.image = Effects.sharpen(self.image)
def blur(self):
self.image = Effects.blur(self.image)