Skip to content

Commit f52b110

Browse files
Sylwester DawidaSylwester Dawida
Sylwester Dawida
authored and
Sylwester Dawida
committed
examples
1 parent a4c7f4c commit f52b110

File tree

9 files changed

+88
-23
lines changed

9 files changed

+88
-23
lines changed

.idea/workspace.xml

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

image.txt

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
2-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⡄⠠⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
3-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠈⢀⢀⢀⢄⠸⣔⣂⣂⠍⢀⠄⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
4-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⣺⣿⣿⣿⣘⡿⣤⣷⢂⡃⠑⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
5-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⣿⣿⣿⣿⣯⣏⣌⣿⡐⠠⡀⠈⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
6-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠐⣿⣿⣿⣿⡯⣿⣏⡯⢲⠔⡁⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
7-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⡀⠙⣿⣿⣿⡗⣿⠧⣛⡗⡞⠂⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
8-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠈⠊⠿⢻⠵⠛⠙⢀⠁⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
9-
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
1+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
2+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
3+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
4+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
5+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
6+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
7+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
8+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
9+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿
10+
⣿⣿⣿⡿⣿⣿⣿⣿⡿⠿⣿⣿⣿⡿⠿⠿⣿⣿⣿⠿⠿⡟⢀⢠⣿⠿⠿⢿⠿⢿⣿⣿⣿
11+
⣿⣿⣿⢀⢀⣽⠛⢫⢀⢀⠈⠟⢀⢀⢀⢀⢀⠿⢀⢀⣡⢀⢀⣿⢀⢀⣶⢀⢀⣿⣿⣿⣿
12+
⣿⣿⠁⢀⢼⢀⢀⣿⢀⢀⣿⢀⢀⣿⢀⢀⣿⢀⢀⣿⠁⢀⣿⠃⢀⣾⡏⢀⣸⣿⣿⣿⣿
13+
⣿⣇⢀⠸⢀⢀⠘⢀⢀⣿⡇⢀⠐⠁⢀⣾⣇⢀⠘⠁⢀⠈⠁⢀⢀⠁⢀⢀⠁⣠⣿⣿⣿
14+
⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
15+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
16+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
17+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
18+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
19+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
20+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
21+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

main.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -518,22 +518,28 @@ def getchar(T):
518518

519519

520520
pass##print(u'\u0123')
521-
if(len(sys.argv) < 4 or len(sys.argv) > 4):
521+
if(len(sys.argv) < 5 or len(sys.argv) > 5):
522522
print("wrong number of arguments ")
523523
exit(-1);
524-
imageFile = sys.argv[3]
525-
treshold = int(sys.argv[2])
526-
binearization = bool(sys.argv[1])
524+
imageFile = str(sys.argv[3])
525+
treshold = int(sys.argv[4])
526+
reverse = bool(int(sys.argv[2]))
527+
binearization = bool(int(sys.argv[1]))
528+
print(str(imageFile)+ " " + str(treshold)+ " " + str(not binearization) + " " + sys.argv[1])
527529
def bin(pixel):
528530
#print(pixel)
531+
retval = 1
529532
if(not binearization):
530533
return pixel
531534
else:
532535
if(pixel[1] > treshold and pixel[2] > treshold and pixel[0] > treshold):
533-
return 1
536+
retval = 1
534537
else:
535-
return 0
536-
538+
retval = 0
539+
if(reverse):
540+
return retval
541+
else:
542+
return not retval
537543

538544
im = Image.open(imageFile)
539545
file = open("image.txt", "w",encoding="utf-8")
@@ -566,5 +572,4 @@ def bin(pixel):
566572
dat = dat + char
567573
file.write(dat+'\n')
568574
dat = u''
569-
im.show()
570575
file.close()

pepe.jpg

16.9 KB
Loading

pepe.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
2+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⡀⢀⢀⢀⢀⢀⢀⡀⠤⢀⠠⡀⢀⢀⢀⢀⢀⢀⢀⢀
3+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⡠⢈⣠⣴⣿⣿⣶⣶⣮⢕⣿⣿⣿⣿⣿⣿⡵⢀⢀⢀⢀⢀⢀⢀
4+
⢀⢀⢀⢀⢀⢀⢀⢀⢊⣤⣿⢫⣪⣷⣿⣿⡿⢦⣖⣖⣮⣿⣿⠶⣶⣓⣙⢐⣄⢀⢀⢀⢀
5+
⢀⢀⢀⢀⢀⢀⢀⢶⣿⣿⣿⣿⡿⢿⢿⡾⣟⣾⣭⣷⣣⣏⢭⣶⠭⣿⡒⠶⠿⠉⡀⢀⢀
6+
⢀⢀⢀⢀⢀⡠⢹⣿⣿⣿⢟⡷⣷⡷⣿⠻⠙⣂⣉⣀⢀⢀⠁⢀⢀⠾⣿⣏⣷⣀⠔⢀⢀
7+
⢀⢀⢀⢀⡜⣾⣷⣿⣿⣿⣿⣿⣷⢵⣤⢀⣿⢿⣿⣻⢽⢝⣿⣽⣿⣷⣿⣿⢟⠃⢀⢀⢀
8+
⢀⢀⢀⠰⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣭⣿⡯⣺⣾⣿⣾⣵⡾⣯⣿⣿⢆⢀⢀⢀⢀
9+
⢀⢀⢀⠁⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢃⢀⢀⢀
10+
⢀⢀⢀⢀⣿⣿⣿⣿⣿⣿⣿⣿⣻⣭⣭⣭⣿⣿⣿⣟⣛⣛⣛⣛⣛⣿⣥⣲⣿⡿⠇⢀⢀
11+
⢀⢀⢀⡌⣿⣿⣿⣿⣿⣿⣿⣮⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣿⣷⣿⣭⣿⣷⡿⠇⢀⢀⢀
12+
⢀⢀⢀⠈⢀⢿⣿⣿⣿⣿⢌⡿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣿⢖⠊⢀⢀⢀⢀⢀⢀
13+
⢀⢀⢀⢀⢀⠐⢄⡙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣟⠽⠊⠁⢀⢀⢀⢀⢀⢀⢀⢀
14+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠈⠉⠉⠉⠁⠉⠉⠉⠉⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀

pobrane.png

5.48 KB
Loading

stop.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
2+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⣀⣀⣀⣀⣀⣀⣀⣀⣀⡐⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
3+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⡀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
4+
⢀⢀⢀⢀⢀⢀⢀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⡀⢀⢀⢀⢀⢀⢀⢀⢀
5+
⢀⢀⢀⢀⢀⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⢰⢀⢀⢀⢀⢀⢀
6+
⢀⢀⢀⢀⢀⢀⣿⣿⢁⣤⣈⣿⣤⢀⣤⣿⠋⣤⡄⢿⣿⢀⣤⠈⣿⣿⢸⢀⢀⢀⢀⢀⢀
7+
⢀⢀⢀⢀⢀⢀⣿⣿⣄⠉⠻⣿⣿⢀⣿⣿⢀⣿⡇⢸⣿⢀⠉⣠⣿⣿⢸⢀⢀⢀⢀⢀⢀
8+
⢀⢀⢀⢀⢀⢀⣿⣿⠻⠿⢀⣿⣿⢀⣿⣿⡄⠿⠃⣼⣿⢀⣿⣿⣿⣿⢸⢀⢀⢀⢀⢀⢀
9+
⢀⢀⢀⢀⢀⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢸⢀⢀⢀⢀⢀⢀
10+
⢀⢀⢀⢀⢀⢀⢀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⢀⢀⢀⢀⢀⢀⢀⢀
11+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
12+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠛⠛⠛⠛⠛⠛⠛⠛⠛⠁⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀
13+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀

woda.jpg

2.43 KB
Loading

woda.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
2+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
3+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
4+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
5+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
6+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
7+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
8+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
9+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿
10+
⣿⣿⣿⡿⣿⣿⣿⣿⡿⠿⣿⣿⣿⡿⠿⠿⣿⣿⣿⠿⠿⡟⢀⢠⣿⠿⠿⢿⠿⢿⣿⣿⣿
11+
⣿⣿⣿⢀⢀⣽⠛⢫⢀⢀⠈⠟⢀⢀⢀⢀⢀⠿⢀⢀⣡⢀⢀⣿⢀⢀⣶⢀⢀⣿⣿⣿⣿
12+
⣿⣿⠁⢀⢼⢀⢀⣿⢀⢀⣿⢀⢀⣿⢀⢀⣿⢀⢀⣿⠁⢀⣿⠃⢀⣾⡏⢀⣸⣿⣿⣿⣿
13+
⣿⣇⢀⠸⢀⢀⠘⢀⢀⣿⡇⢀⠐⠁⢀⣾⣇⢀⠘⠁⢀⠈⠁⢀⢀⠁⢀⢀⠁⣠⣿⣿⣿
14+
⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
15+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
16+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
17+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
18+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
19+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
20+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
21+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

0 commit comments

Comments
 (0)