Repository navigation
Expand file tree
/
Copy pathlayouting.py
More file actions
executable file
·96 lines (75 loc) · 2.71 KB
/
Copy pathlayouting.py
File metadata and controls
executable file
·96 lines (75 loc) · 2.71 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import PySimpleGUI as sg
sg.theme("DefaultNoMoreNagging")
file_list_column = [
[sg.Text("Open Image Folder :")],
[sg.In(size=(20, 1), enable_events=True, key="folder_images"),
sg.FolderBrowse()],
[sg.Text("Choose an images from list : ")],
[sg.Listbox(values=[], size=(15, 10),
key="list_image", enable_events=True)],
[sg.Text("Image Information : ")],
[sg.Text(size=(18, 1),
key="image_size")],
[sg.Text(size=(18, 1),
key="image_color_depth")],
]
input_image_preview = [
[sg.Text("Image Input :")],
[sg.Text(size=(20, 1), key="image_path")],
[sg.Image(key="preview_input_image")],
]
list_processing = [
[sg.Text("Main Feature : ")],
[sg.Button("Image Thresholding", size=(14, 1), key="image_thresholding")],
[sg.Button("Image Negative", size=(14, 1), key="image_negative")],
[sg.Button("Image Brightness", size=(14, 1), key="image_brigtness")],
[sg.Button("Equalization Greyscale", size=(16, 1), key="equalization_greyscale")],
[sg.Button("Equalization Color", size=(16, 1), key="equalizer_greyscale")],
[
# TEXT LABEL
sg.Text("Image Thresholding : ",
key="text_thresholding", visible=False),
sg.Text("Image Brightness : ", key="text_brightness", visible=False),
# Input
# Slider
sg.Slider(range=(0, 255), size=(9, 20),
orientation='h',
key="slider_thresholding",
default_value=0, visible=False),
sg.Slider(range=(0, 255), size=(9, 20),
orientation='h',
key="slider_brightness",
default_value=0, visible=False),
# Button
sg.Button("Apply", size=(9, 1),
key="submit_thresholding", visible=False),
sg.Button("Apply", size=(9, 1),
key="submit_brightness", visible=False),
],
[sg.Button("Reset", size=(14, 1), key="cancel", visible=False)]
]
output_image_preview = [
[sg.Text("Image Output:")],
[sg.Text(size=(20, 1), key="type_processing")],
[sg.Image(key="preview_output_image")],
]
output_histogram_preview = [
[sg.Text("Histogram Output:")],
[sg.Text(size=(20, 1), key="type_processing")],
[sg.Image(key="preview_output_histogram")],
]
layout = [
[
sg.Column(file_list_column),
sg.VSeperator(),
sg.Column(input_image_preview),
sg.VSeperator(),
sg.Column(list_processing),
sg.VSeperator(),
sg.Column(output_image_preview),
sg.VSeperator(),
sg.Column(output_histogram_preview),
]
]
window = sg.Window("Mini Image Editor", layout)
filename_out = "output.png"