- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path16.py
More file actions
Latest commit
16 lines (12 loc) · 435 Bytes
/
Copy path16.py
File metadata and controls
16 lines (12 loc) · 435 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fromPILimportImage
defstraighten(source):
target=source.copy()
foryinrange(source.size[1]):
line= [source.getpixel((x, y)) forxinrange(source.size[0])]
pink=line.index(195)
line=line[pink:] +line[:pink]
forx, pixelinenumerate(line):
target.putpixel((x, y), pixel)
returntarget
out=straighten(Image.open("mozart/mozart.gif"))
out.save("mozart/out.gif")