-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
680 lines (620 loc) · 23.3 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>JavaScript Image Processing</title>
<meta name="description" content="JavaScript Image Processing Web App">
<meta name="author" content="Alderson Chiu">
<link rel="icon" href="heart-fill.svg">
<style>
* + * {
color: rgb(143, 252, 158);
background-color: rgb(37, 42, 51);
box-sizing: border-box;
margin: .4em 0;
font-family: monospace;
}
@media (min-width: 35em) {
.col {
display: table-cell
}
.\31 {
width: 5%
}
.\33 {
width: 22%
}
.\34 {
width: 30%
}
.\35 {
width: 40%
}
.\32 {
width: 15%
}
.\36 {
width: 50%;
}
.row {
display: table;
border-spacing: 1em 0
}
}
.row, .w-100 {
width: 100%
}
.card:focus, hr {
outline: 0;
border: solid #fa0;
}
.card, pre {
padding: 1em;
border: solid rgb(115 124 129);
overflow: hidden;
}
button:hover, a:hover {
opacity: .6
}
.c {
max-width: 60em;
padding: 1em;
margin: auto;
font: 1em/1.6 monospace;
}
h1 { font-size: 2.5em; text-align: center;}
a {
float: right;
color: #fa0;
text-decoration: none;
}
pre {
overflow: auto;
}
td, th {
padding: 1em;
text-align: left;
border-bottom: solid #eee;
}
button .primary {
color: white;
background: #9c27b0 !important;
border: solid rgb(91 99 102) !important;
}
button {
background: #2E3440 !important;
padding: 0.8em;
letter-spacing: .1em;
text-transform: uppercase;
border: solid;
border-color: rgb(91 99 102) !important;
color: rgb(141, 255, 26) !important;
font: 12px monospace;
}
.container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 90vh;
}
input[type="file"] {
position: absolute;
z-index: -1;
top: 6px;
left: 0px;
font-size: 15px;
color: rgb(153, 153, 153);
}
.button-wrap {
position: relative;
}
.new-button {
display: inline-block;
padding: 8px 12px;
cursor: pointer;
border-radius: 4px;
font-size: 16px;
color: #00f3ff;
text-align: center;
width: -webkit-fill-available;
width: -moz-available;
}
span {
display: flex;
align-items: center;
justify-content: center;
}
img {
max-width: 100%;
height: auto;
width: auto;
}
input[type=text] {
width: 100%;
border: 2px solid #aaa;
border-radius: 4px;
margin: 8px 0;
outline: none;
padding: 8px;
box-sizing: border-box;
transition: .3s;
text-align: center;
}
input[type=text]:focus {
border-color: dodgerBlue;
box-shadow: 0 0 8px 0 dodgerBlue;
}
#filterBox {
resize: both;
}
#hue {
background: linear-gradient(
to right,
hsl(0, 100%, 50%),
hsl(60, 100%, 50%),
hsl(120, 100%, 50%),
hsl(180, 100%, 50%),
hsl(240, 100%, 50%),
hsl(300, 100%, 50%),
hsl(0, 100%, 50%)
) !important;
}
#saturation {
background: linear-gradient(to right, hsl(90, 0%, 50%), hsl(90, 100%, 50%)) !important;
}
#intensity {
background: linear-gradient(to right, hsl(0, 50%, 0%), aqua) !important;
}
#Red {
background: linear-gradient(to right, cyan, red) !important;
}
#Green {
background: linear-gradient(to right, magenta, green) !important;
}
#Blue {
background: linear-gradient(to right,#FCE205, blue) !important;
}
#whiteningRange, #transformXr, #transformYr, #sheerAngler, #Gamma, #Power, #Scale {
background: linear-gradient(to right, #000000, #ffffff) !important;
}
#hue, #saturation, #intensity, #Red, #Green, #Blue, #Gamma, #Power, #Scale, #whiteningRange, #transformXr, #transformYr, #sheerAngler, form {
width: 260px;
}
.option {
color: mediumaquamarine;
background-color: inherit;
}
.output {
color: #B0E0E6;
}
form {
width: 260px;
height: 260px;
margin: 0 auto;
}
input[type="range"] {
-webkit-appearance: none;
height: 20px;
background: linear-gradient(to right, #9A2720 0%, #9A2720 100%) no-repeat center;
overflow: hidden;
outline: none;
margin: auto 20px 10px;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 20px;
height: 20px;
background: #F26B5E;
position: relative;
z-index: 3;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
}
input[type="range"]::-webkit-slider-thumb:after {
content: " ";
width: 160px;
height: 10px;
position: absolute;
z-index: 1;
right: 20px;
top: 5px;
background: #ff5b32 !important;
background: linear-gradient(to right, #f088fc 1%, #AC6CFF 70%);
}
p {
width: 100%;
text-align: center;
color: white;
font-size: 32px;
margin-top: 30px;
}
.collapse:after {
content: ">";
color: #FFFFFF;
font-weight: bold;
float: right;
margin-left: 5px;
}
#exifInfo {
color: lawngreen;
background-color: black !important;
font: 1em/1.6 monospace;
}
.collapsible {
margin-bottom: auto;
cursor: pointer;
width: 100%;
border: none;
outline: none;
font-size: 15px;
}
.collapsible:after {
content: '\002B';
font-weight: bold;
float: right;
margin-left: 5px;
}
.active, .collapsible:hover {
background-color: transparent;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
color: #00f3ff !important;
}
.active:after {
content: "\2212";
}
.content {
width: -webkit-fill-available;
width: -moz-available;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
text-align: center;
object-fit: cover;
padding: 0 18px;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
outline: 0;
box-shadow: none;
border: 0 !important;
background: #5c6664;
background-image: none;
flex: 1;
padding: 0 .5em;
color: #fff;
cursor: pointer;
font-size: 1em;
}
select::-ms-expand {
display: none;
}
.select {
position: relative;
display: flex;
width: 20em;
height: 3em;
line-height: 3;
background: #5c6664;
overflow: hidden;
border-radius: .25em;
}
.select::after {
content: '\25BC';
position: absolute;
top: 0;
right: 0;
padding: 0 1em;
background: #2b2e2e;
cursor: pointer;
pointer-events: none;
transition: .25s all ease;
}
.select:hover::after {
color: #23b499;
}
.banner {
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
}
.breathing {
position: relative;
transform: scale(1);
will-change: transform, opacity;
animation: breathe 5s ease-in-out infinite, opacityGlow 5s ease-in-out infinite;
}
.touch-target {
font-size: 24px;
}
@keyframes breathe {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
}
@keyframes opacityGlow {
0%, 100% {
opacity: 0.95;
}
50% {
opacity: 1;
}
}
#originalBox{
visibility: hidden;
}
</style>
</head>
<body>
<span>
<a href="Privacy-Policy.pdf" target="_blank" referrerpolicy="strict-origin-when-cross-origin" class="touch-target">Privacy Policy(PDF)</a>
<a href="BSOD.me%20User%20Manual.pdf" target="_blank" referrerpolicy="strict-origin-when-cross-origin" class="touch-target">|User Manual(PDF)|</a>
<a href="BSOD.me%20使用者手冊.pdf" target="_blank" referrerpolicy="strict-origin-when-cross-origin" class="touch-target">使用者手冊(PDF)</a>
</span>
<div class="banner" role="banner">
<h1 class="breathing">JavaScript Image Processing</h1>
</div>
<div class="card w-100">
<div class="button-wrap">
<label class="new-button" for="userImage">Choose Image(JPG/PNG)</label>
<input type="file" id="userImage" name="userImage" accept="image/png, image/jpeg" class="touch-target">
</div>
</div>
<div class="row">
<div class="6 col">
<fieldset>
<legend class="collapsible">Simple Processing:</legend>
<div class="content">
<button id="inverse">Inverse</button>
<button id="grayscale">Grayscale</button>
<button id="sepia">Sepia</button>
<button id="binary">Binary</button>
<button id="dither">Dither</button>
<button id="floyd">Floyd-Steinberg</button>
<button id="histogramEq">Histogram Equalization</button>
<button id="flip">Flip</button>
<button id="fish">Fish</button>
<button id="panning">Panning</button>
<button id="sheer">Sheer</button>
</div>
</fieldset>
<fieldset>
<legend class="collapsible">Gamma/Noises:</legend>
<div class="content">
<button id="adjustGamma">Gamma Adjustment</button>
<button id="uniformNoise">Uniform</button>
<button id="gaussianNoise">Gaussian</button>
<button id="exponentialNoise">Exponential</button>
<button id="impulseNoise">Impulse</button>
</div>
</fieldset>
<fieldset>
<legend class="collapsible">Filters:</legend>
<div class="content">
<button id="laplacianFilter">Laplacian</button>
<button id="extendLaplacianFilter">Extended Laplacian</button>
<button id="boxBlurFilter">Box Blur</button>
<button id="highBoxBlurFilter">High Box Blur</button>
<button id="gaussianBlurFilter">Gaussian Blur</button>
<button id="medianBlurFilter">Median Blur</button>
<button id="sharpenFilter">Sharpen</button>
<br>
<button id="unsharpFilter">Unsharp</button>
<button id="embossFilter">Emboss</button>
<button id="reliefFilter">Relief</button>
<button id="sobelFilter">Sobel(E.D)</button>
<button id="prewittFilter">Prewitt(E.D)</button>
<button id="laplacianEdgeFilter">Laplacian(E.D)</button>
<button id="robertFilter">Robert(E.D)</button>
</div>
</fieldset>
</div>
<div class="3 col">
<fieldset>
<legend class="collapsible">File/Edit/View</legend>
<div class="content">
<button id="revertImage">Undo</button>
<button id="redoImage">Redo</button>
<button id="cancelFilter">Reset</button>
<button id="savepoint">Snapshot</button>
<button id="loadSave">Load Snapshot</button>
<button id="download">Download</button>
<br>
<button id="fullscreenCanvas">Fullscreen(Canvas)</button>
<button id="fullscreen">Fullscreen</button>
<button id="closeFullscreen">Exit Fullscreen</button>
</div>
</fieldset>
<fieldset>
<legend class="collapsible">Extended:</legend>
<div class="content">
Captcha(Filter+OCR): <span id="captcha" class="output">Not Detected</span>
Captcha(Custom Model): <span id="captchaCustom" class="output">Not Detected</span>
<button id="solveCaptcha">Crack Captcha</button>
<br>
Model Status: <span class="output" id="modelLoadStatus">Not Loaded</span>
<button id="objectDetection">Launch Object Detection
</button>
</div>
</fieldset>
</div>
<div class="2 col" id="extraOptions">
<fieldset>
<legend class="collapsible">Parameters:</legend>
<div class="content">
<div>
<input type="checkbox" id="allowMultipleFilterOn">
<label for="allowMultipleFilterOn">Allow Filter Overlap</label>
</div>
<div>
<input type="checkbox" id="displayOriginalImage">
<label id="focusEditing" for="displayOriginalImage">Show Original</label>
</div>
<div>
<input type="checkbox" id="focusMode">
<label for="focusMode">Focus Mode(Desktop)</label>
</div>
<div>
<input type="checkbox" id="specialShit">
<label for="specialShit">School Captcha(Filter+OCR)</label>
</div>
<div>
<input type="checkbox" id="loadCustomModel">
<label for="loadCustomModel">School Captcha(self train)</label>
</div>
<label for="edgeDetectionCheck">E.D Setup :</label>
<select id="edgeDetectionCheck" class="option">
<option value="filterValue">Neon/RGB</option>
<option value="grayFilterValue">Grayscale</option>
<option value="edgeValue">Edge</option>
</select>
<br>
<label for="models">Object Detection Setup :</label>
<select id="models" class="option">
<option value="CocoSsd">COCO-SSD</option>
<option value="YOLO">YOLO-Tiny</option>
</select>
<br>
<label for="flipDirection">Flip/Sheer Direction:</label>
<select id="flipDirection" class="option">
<option value="horizontal">Horizontal/Y</option>
<option value="vertical">Vertical/X</option>
</select>
<div>
<label for="exifInfo">EXIF Details: </label><br>
<textarea id="exifInfo" class="c" readonly></textarea>
</div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="2 col">
<fieldset>
<legend>Customize Values:</legend>
<div class="3 row">
<button class="collapsible">HSI</button>
<div class="content">
<label for="hue">H</label>
<input type="range" id="hue" class="inputRange" value="0" min="0" max="360">
<br>
<label for="customH">Hue</label>
<input type="text" id="customH" class="inputNumber" value="0" readonly>
<br>
<label for="saturation">S</label>
<input type="range" id="saturation" class="inputRange" value="0" min="-100" max="100">
<br>
<label for="customS">Saturation</label>
<input type="text" id="customS" class="inputNumber" value="0" readonly>
<br>
<label for="intensity">I</label>
<input type="range" id="intensity" class="inputRange" value="0" min="-100" max="100">
<br>
<label for="customI">Intensity</label>
<input type="text" id="customI" class="inputNumber" value="0" readonly>
<br>
</div>
<button class="collapsible">Color Balance</button>
<div class="content">
<label for="Red">C/R</label>
<input type="range" id="Red" class="inputRange" value="0" min="-100" max="100">
<br>
<label for="customR">Cyan / Red</label>
<input type="text" id="customR" class="inputNumber" value="0" readonly>
<br>
<label for="Green">M/G</label>
<input type="range" id="Green" class="inputRange" value="0" min="-100" max="100">
<br>
<label for="customG">Magenta / Green</label>
<input type="text" id="customG" class="inputNumber" value="0" readonly>
<br>
<label for="Blue">Y/B</label>
<input type="range" id="Blue" class="inputRange" value="0" min="-100" max="100">
<br>
<label for="customB">Yellow / Blue</label>
<input type="text" id="customB" class="inputNumber" value="0" readonly>
<br>
</div>
<button class="collapsible">Gamma/Noises</button>
<div class="content">
<label for="Gamma">G</label>
<input type="range" id="Gamma" class="inputRange noSync" value="2" min="0.1" max="10" step="0.1">
<br>
<label for="customGamma">Gamma</label>
<input type="text" id="customGamma" class="inputNumber noSync" value="2" readonly>
<br>
<label for="Scale">S</label>
<input type="range" id="Scale" class="inputRange noSync" value="40" min="1" max="255">
<br>
<label for="customScale">Scale</label>
<input type="text" id="customScale" class="inputNumber noSync" value="40" readonly>
<label for="Power">P</label>
<input type="range" id="Power" class="inputRange noSync" value="0.05" min="0.01" max="1" step="0.01">
<br>
<label for="Pps">Power</label>
<input type="text" id="Pps" class="inputNumber noSync" value="0.05" readonly>
<br>
</div>
<button class="collapsible">Skin Whitening</button>
<div class="content">
<label for="whiteningRange">Whitening Range</label>
<input type="range" id="whiteningRange" class="inputRange noSync" value="1.26" min="0.1" max="2" step="0.01">
<br>
<label for="customWhitening">Strength</label>
<input type="text" id="customWhitening" class="inputNumber" value="1.26" readonly>
<br>
<button id="validateYCbCr">Validate YCbCr</button>
<br>
<button id="showSkinArea">Show Skin Area</button>
<br>
<button id="skinWhitening">Whitening Skin</button>
</div>
<button class="collapsible">Transform</button>
<div class="content">
<label for="transformXr">X</label>
<input type="range" id="transformXr" class="inputRange noSync" value="0" min="0" max="10">
<br>
<label for="transformXt">X Axis:</label>
<input type="text" id="transformXt" class="inputNumber noSync" value="0" readonly>
<label for="transformYr">Y</label>
<input type="range" id="transformYr" class="inputRange noSync" value="0" min="0" max="10">
<br>
<label for="transformYt">Y Axis:</label>
<input type="text" id="transformYt" class="inputNumber noSync" value="0" readonly>
<br>
<label for="sheerAngler">S</label>
<input type="range" id="sheerAngler" class="inputRange noSync" value="30" min="1" max="360">
<br>
<label for="sheerAnglet">Sheer Angle:</label>
<input type="text" id="sheerAnglet" class="inputNumber noSync" value="30" readonly>
</div>
</div>
</fieldset>
</div>
<div class="10 col">
<div class="row">
<div class="card col" id="filterBox">
<span id="processed">Processed :</span>
<canvas id="filterResult" class="w-100"></canvas>
</div>
<div id="originalBox">
<span id="original">Original :</span>
<canvas id="originalImage" class="w-100"></canvas>
</div>
</div>
</div>
</div>
<script defer src="scripts/iphw.js"></script>
</body>
</html>