-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
101 lines (92 loc) · 3.27 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
<!DOCTYPE html><html><head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Convolution Matrix filter</title>
<link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000">
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
<style>
body {
font-family: serif;
font-size: 1em;
}
#settings {
background-color: white;
margin-top: -200px;
padding: 8px 10px 12px;
position: absolute;
right: 20px;
top: 50%;
}
input, select, button {
margin: 4px 1px;
}
input[type=number] {
width: 48px;
}
.rightify {
text-align: right;
}
</style>
</head><body>
<canvas id="canvas"></canvas>
<div id="settings">
<fieldset>
<legend>Filter</legend>
<select id="filters" onchange="setPresetFilter( this.value )">
<option value="identity">Identity</option>
<option value="blur">Box blur</option>
<option value="gaussian">Gaussian blur</option>
<option value="sharpen">Sharpen</option>
<option value="edgeDetect">Edge detect</option>
<option value="unsharp">Unsharp mask</option>
<option value="emboss">Emboss</option>
</select>
<br/>
<br/>
<input id="a01" type="number" value="0" />
<input id="a00" type="number" value="0" />
<input id="a02" type="number" value="0" />
<input id="a03" type="number" value="0" />
<input id="a04" type="number" value="0" />
<br/>
<input id="a10" type="number" value="0" />
<input id="a11" type="number" value="0" />
<input id="a12" type="number" value="0" />
<input id="a13" type="number" value="0" />
<input id="a14" type="number" value="0" />
<br/>
<input id="a20" type="number" value="0" />
<input id="a21" type="number" value="0" />
<input id="a22" type="number" value="0" />
<input id="a23" type="number" value="0" />
<input id="a24" type="number" value="0" />
<br/>
<input id="a30" type="number" value="0" />
<input id="a31" type="number" value="0" />
<input id="a32" type="number" value="0" />
<input id="a33" type="number" value="0" />
<input id="a34" type="number" value="0" />
<br/>
<input id="a40" type="number" value="0" />
<input id="a41" type="number" value="0" />
<input id="a42" type="number" value="0" />
<input id="a43" type="number" value="0" />
<input id="a44" type="number" value="0" />
<br/>
<br/>
<div class="rightify">
<button onclick="reset()">Reset</button>
<button id="apply" onclick="setCustomFilter()">Apply</button>
</div>
</fieldset>
<br/>
<div class="rightify">
<a href="https://en.wikipedia.org/w/index.php?title=Kernel_(image_processing)" target="_blank">Algorithm description</a><br/>
<a href="https://github.com/ytiurin/imagefilter" target="_blank">Fork on Github</a>
</div>
</div>
<script type="text/javascript" src="apply-filter.js"></script>
<script type="text/javascript" src="index.js">
</script>
</body></html>