-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
179 lines (179 loc) · 9.88 KB
/
index.html
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/png" href="./img/icon-site.png"/>
<title>Editor de Imagens</title>
<script src="https://www.jsdelivr.com/package/npm/chart.js"></script>
</head>
<body>
<header>
<div class="div-header">
<h1>Editor de Imagens</h1>
<p>**As imagens devem ter um tamanho parecido;</p>
<p>**Formatos permtidos: .jpg, .jpeg, .png, .bmp.</p>
</div>
</header>
<main>
<div class="div-container-images">
<section class="section-container">
<h3>Imagem 1</h3>
<img src="" alt="" id="img-loaded1">
<div class="canvas-container" id="div-canvas1">
<canvas id="canvas-img1"></canvas>
</div>
<input type="file" id="input-file1" class="input-files" onchange="openFile('1')">
<button id="upload-file1" class="button-upload">Carregar Imagem</button>
<div class="div-container">
<p>Operações com a imagem 1.</p>
<div>
<button type="button" class="button-default" onclick="rgbTo8Bit1()">To Gray</button>
<button type="button" class="button-default" onclick="rgbTo1Bit1()">To Binário</button>
<button type="button" class="button-default" onclick="not1()">NOT</button>
</div>
</div>
</section>
<section class="section-container">
<h3>Imagem 2</h3>
<img src="" alt="" id="img-loaded2">
<div class="canvas-container" id="div-canvas2">
<canvas id="canvas-img2"></canvas>
</div>
<input type="file" id="input-file2" class="input-files" onchange="openFile('2')">
<button id="upload-file2" class="button-upload">Carregar Imagem</button>
<div class="div-container">
<p>Operações com a imagem 2.</p>
<div>
<button type="button" class="button-default" onclick="rgbTo8Bit2()">To Gray</button>
<button type="button" class="button-default" onclick="rgbTo1Bit2()">To Binário</button>
<button type="button" class="button-default" onclick="not2()">NOT</button>
</div>
</div>
</section>
</div>
<div class="div-buttons">
<div class="div-container">
<p>Operações Aritméticas:</p>
<span>*Se os inputs forem preenchidos as alterações serão feitas apenas na imagem 1.</span>
<span>Com exceção do campo Blending que é obrigatório preencher o input, e usará as duas imagens.</span>
<div class="div-flex">
<div class="div-button-input">
<button type="button" class="button-default" onclick="somar()">Somar</button>
<input class="input-number" id="input-somar" type="number" min="0" max="255">
</div>
<div class="div-button-input">
<button type="button" class="button-default" onclick="subtrair()">Subrair</button>
<input class="input-number" id="input-subtrair" type="number" min="0" max="255">
</div>
<div class="div-button-input">
<button type="button" class="button-default" onclick="multiplicar()">Multiplicar</button>
<input class="input-number" id="input-multiplicar" type="number" min="0" max="255">
</div>
<div class="div-button-input">
<button type="button" class="button-default" onclick="dividir()">Dividir</button>
<input class="input-number" id="input-dividir" type="number" min="0" max="255">
</div>
<button type="button" class="button-default" onclick="media()">Média</button>
<div class="div-button-input">
<button type="button" class="button-default" onclick="blending()">Blending</button>
<input class="input-number" id="input-blending" type="number" min="0" max="1" step="0.01">
<span class="span-error">*Obrigatório!</span>
</div>
</div>
</div>
<div class="div-container">
<p>Operações Lógicas:</p>
<div>
<button type="button" class="button-default" onclick="and()">AND</button>
<button type="button" class="button-default" onclick="or()">OR</button>
<button type="button" class="button-default" onclick="xor()">XOR</button>
</div>
</div>
<div class="div-container">
<p style="margin: 1em;">Espelhar imagem:</p>
<div>
<button type="button" class="button-default" onclick="mirrorImage()">Espelhar</button>
</div>
</div>
</div>
<div class="div-container-result">
<section class="section-container">
<h3>Resultado</h3>
<img src="" alt="" id="img-result">
<div class="canvas-container canvas-container--result">
<canvas id="canvas-result"></canvas>
</div>
<button id="download" class="button-upload">Exportar Imagem</button>
</section>
</div>
<div class="spacer"></div>
<div class="center">
<h2>Equalização / Filtros</h2>
<div class="div-container-images">
<section class="section-container">
<h3>Imagem Original</h3>
<img src="" alt="" id="img-loaded3">
<div class="canvas-container" id="div-canvas3">
<canvas id="canvas-img3"></canvas>
</div>
<input type="file" id="input-file3" class="input-files" onchange="openFile('3')">
<button id="upload-file3" class="button-upload">Carregar Imagem</button>
</section>
<section class="section-container">
<div class="div-container">
<p>Equalizar & Filtrar:</p>
<div class="change-filters">
<button class="filter filter-3 filter-changed" onclick="chooseFilter(this)">3x3</button>
<button class="filter filter-5" onclick="chooseFilter(this)">5x5</button>
<button class="filter filter-7" onclick="chooseFilter(this)">7x7</button>
</div>
<div class="div-align-flexcolumns">
<div class="div-flex-column">
<button class="button-default" onclick="equalization()">Equalizar</button>
<button class="button-default" onclick="filterMean()">Média</button>
<button class="button-default" onclick="filterMin()">Mínima</button>
<button class="button-default" onclick="filterMax()">Máxima</button>
</div>
<div class="div-flex-column">
<button class="button-default" onclick="filterMedian()">Mediana</button>
<button class="button-default" onclick="filterOrder()">Ordem</button><input class="input-set-order" type="number" min="1" max="49" value="9">
<button class="button-default" onclick="filterSmoothing()">Suavização</button>
<button class="button-default" onclick="filterGaussian()">Gaussiana</button><input class="input-set-variation" type="number" step="0.01" min="0.01" max="4" value="1.00">
</div>
</div>
</div>
</section>
<section class="section-container">
<h3>Imagem Modificada</h3>
<img src="" alt="" id="img-loadedEq">
<div class="canvas-container" id="div-canvasEq">
<canvas id="canvas-imgEq"></canvas>
</div>
<button id="downloadEq" class="button-upload">Exportar Imagem</button>
</section>
</div>
<div class="div-collapses">
<details class="collapse">
<summary class="collapse-title">Histograma da Imagem Original</summary>
<div class="collapse-content">
<canvas id="chartOriginal" width="1000" height="500"></canvas>
</div>
</details>
<details class="collapse">
<summary class="collapse-title">Histograma da Imagem Equalizada/Filtrada</summary>
<div class="collapse-content">
<canvas id="chartEqualizado" width="1000" height="500"></canvas>
</div>
</details>
</div>
</div>
</main>
<footer>
<div><span>Copyright © 2022 - Institutional Site - Jaisson Bassanesi</span></div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/chart.min.js" integrity="sha512-sW/w8s4RWTdFFSduOTGtk4isV1+190E/GghVffMA9XczdJ2MDzSzLEubKAs5h0wzgSJOQTRYyaz73L3d6RtJSg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</body>
<script src="script.js"></script>
</html>