Skip to content

Commit 3ca46f3

Browse files
Initial commit
0 parents  commit 3ca46f3

10 files changed

Lines changed: 716 additions & 0 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Image-Reprocessor
2+
Reprocesses images or just basically clears any traces if there is, anonymity it is.

inputs/test10.png

218 Bytes
Loading

inputs/test21.png

263 Bytes
Loading

inputs/test9.png

149 Bytes
Loading

main.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from sys import argv
2+
from os import listdir
3+
import colorama
4+
colorama.init()
5+
6+
from PIL import Image
7+
from numpy import ndarray, uint8
8+
9+
parentPath = argv[0].replace(argv[0].split("\\")[-1], "")
10+
inputs = parentPath + "inputs\\"
11+
outputs = parentPath + "outputs\\"
12+
13+
def reprocessImage(imagePath):
14+
outputPath = outputs + "Processed " + imagePath.split("\\")[-1]
15+
16+
# len(image.mode): RGB = 3, RGBA = 4
17+
image = Image.open(imagePath)
18+
data = ndarray((image.height, image.width, len(image.mode)), dtype=uint8, buffer=image.tobytes())
19+
Image.fromarray(data, mode=image.mode).save(outputPath)
20+
21+
return outputPath
22+
23+
print('''
24+
___ ____
25+
|_ _|_ __ ___ ____ ____ ___ ____ | _ \ ___ ____ ____ ___ ___ ___ ___ ___ ___ ____
26+
| || '_ ` _ \ / _ |/ _ |/ _ \ __| | |_) / _ \ _ \| __/ _ \ / __/ _ \/ __/ __|/ _ \| __|
27+
| || | | | | | (_| | (_| | __/ | | _ < __/ |_) | | | (_) | (_| __/\__ \__ \ (_) | |
28+
|___|_| |_| |_|\__,_|\__, |\___|_| |_| \_\___| __/|_| \___/ \___\___||___/___/\___/|_|
29+
|___/ |_|
30+
''')
31+
32+
input("Press enter to process the folder:\n" + inputs + "\n\nand output its outputs into the folder:\n" + outputs + "\n")
33+
34+
for fileName in listdir(inputs):
35+
reprocessImage(inputs + fileName)
36+
print("Processed: " + fileName)
37+
38+
input()

outputs/Processed test10.png

178 Bytes
Loading

outputs/Processed test21.png

213 Bytes
Loading

outputs/Processed test9.png

98 Bytes
Loading

0 commit comments

Comments
 (0)