Skip to content

Commit 542d0ca

Browse files
committed
Added README.md file and inverter.py in Image-Inverter directory
1 parent 7a36ada commit 542d0ca

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ImageInverter
2+
===============
3+
## Describtion
4+
This project is an implementaion of a CLI program that inverts image/set of images.
5+
6+
## Requirements
7+
First, you need to install `Pillow` package. You can check the official instructions here[https://pillow.readthedocs.io/en/stable/installation.html] and follow the instructions according to the OS you are running.
8+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python3
2+
3+
from PIL import Image, ImageOps
4+
import sys, os
5+
6+
def main():
7+
if len(sys.argv) == 1:
8+
print("Please provide files to operate on!")
9+
sys.exit(1)
10+
11+
for file in sys.argv:
12+
# TODO: add a check that the files are jpg
13+
file_name = os.path.splittext(file)
14+
with Image.open(file) as image:
15+
inverted_image = ImageOps.invert(image)
16+
inverted_image.save(filename + "_inverted", "JPEG")
17+
18+
sys.exit(0)
19+
20+
if __name__ == '__main__':
21+
main()

IMAGES & PHOTO SCRIPTS/ImageInverter

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit a3d7f17ad5b72d922ec85e18a6136c205db20047

0 commit comments

Comments
 (0)