-
Notifications
You must be signed in to change notification settings - Fork 34
/
index.html
543 lines (513 loc) · 17.7 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>蒸 気 機 - 蒸汽波 - 蒸汽波图片生成器 - 虚拟信号风格化影像后期工具</title>
<link rel="stylesheet" href="document.css?r=20220403">
<meta name="viewport" content="width=device-width,user-scalable=0">
</head>
<body>
<div class="app">
<div class="ctrl-box">
<!--<label>-->
<!--<input type="checkbox" v-model="showStyle">选项-->
<!--</label>-->
<div class="output">
<img :src="src" v-if="src" :data-wide="style.wide">
</div>
<div class="side-left-box">
<h1>蒸 気 機</h1>
<div class="style-list-box">
<div class="global-style-list">
<a v-for="_style in styles"
:class="{active:_style.name === style.name}"
@click="setStyle(_style)">
<span class="name" v-text="_style.name"></span>
<span class="cor vote"></span>
</a>
</div>
<div class="user-style-list" v-if="userStyles.length">
<h4>个人预设</h4>
<a v-for="_style in userStyles"
:class="{active:_style.name === style.name}"
@click="setStyle(_style)">
<span class="name" v-text="_style.name"></span>
<span class="cor remove" @click.stop.prevent="removeUserStyle(_style)"></span>
</a>
</div>
<div class="user-style-list" v-if="globalStyles.length">
<h4>公共预设</h4>
<a v-for="_style in globalStyles"
:class="{active:_style.name === style.name}"
@click="setStyle(_style)">
<span class="name" v-text="_style.name"></span>
<span class="cor vote"></span>
<!-- @click.stop.prevent="voteStyle(_style)" -->
</a>
</div>
</div>
</div>
<div class="img-list" @scroll="imagesScroll">
<img v-for="image,index in images"
:key="index"
crossOrigin="Anonymous"
:src="image.show ? imageBaseURi + image.src : null"
@click="setImageAndDraw"
@load="index===0 && setImageAndDraw($event)">
</div>
<div class="side-right-box">
<div class="btn-box">
<a class="btn big wire" @click="chooseFile">打开图像</a>
<button @click="output()" class="btn big">导出图像</button>
</div>
<div class="style" v-if="showStyle">
<div class="group">
<div class="body content">
<h2>📹「 蒸 気 機 」</h2>
<p>虚拟信号蒸汽波风格化影像后期工具。</p>
<p>通过抽象虚拟信号影像展现过程中的各种可能性、实现了九十年代影像风格的重现。</p>
<p>
全做:<a href="https://weibo.com/reiove" target="_blank">@卜卜口</a>
/
反馈:<a href="https://github.com/itorr/vaporwave" target="_blank">GitHub</a>
/
打赏:<a href="https://lab.magiconch.com/nbnhhsh/sponsor.png" target="_blank">二维码</a>
</p>
<p>这是一个寻找影像风格化手段的过程中整理出的产物,没找到理想的工具所以自己整了个轮子。</p>
<p>旨在通过 <b>参数化</b>、<b>可视化</b> 来提升影像风格化的摸索效率。</p>
<p class="pink">
<span class="line">点击<b class="line cur" @click="chooseFile">打开图像</b>即可使用本工具,</span>
<span class="line">同时支持<b>拖拽</b>及<b>粘贴</b>图片。</span>
</p>
<p class="pink">
无法保存的情况请使用自带浏览器!!
</p>
<p class="pink">
在本工具内打开的图像不会上传到服务器。<br>
<del>根据 EXIF 旋转图像功能还没写。</del>
</p>
<p>大家在摸索到理想的画面风格时,可以通过 <b class="line cur" @click="postStyle">提交成为公共预设</b> 功能分享预设给大家。</p>
<p>
<span class="line">预设名称限制为 <b title="/^[\u0800-\u9fa5]+$/">四字中日文</b> <del>不需要加空格</del>,</span>
<span class="line">提交的预设经审核通过即可显示。</span>
</p>
<p>
如需高质量影像,可勾选
<label><input type="checkbox" v-model="style.sizeOrigin">原始尺寸处理</label>
</p>
<p>有适合当样图的影像可以 <b class="line cur" @click="uploadCapture">点这里上传</b> 授权我!</p>
<p>
有适合抽象的概念可以和我说,不一定能做 🤔<br>
有什么建议都可以和我说,不一定听 😠
</p>
<p>
← 最左面是公共预设列表,现在是我的一些预设<br>
↙ 网面下缘是样图列表,可以配合预设预览风格<br>
↓ 往下滚动是选项设置列表,最下可保存和分享
</p>
</div>
</div>
<div class="group">
<div class="head">
<h3>基礎設置</h3>
</div>
<div class="body">
<div class="label-box">
<div class="head">
<b>画面亮度</b>
<span v-text="style.light"></span>
</div>
<input type="range" v-model.number="style.light" min="0" max="4" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>画面反差</b>
<span v-text="style.contrast"></span>
</div>
<input type="range" v-model.number="style.contrast" min="0" max="4" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>暗部褪色</b>
<span v-text="style.darkFade"></span>
</div>
<input type="range" v-model.number="style.darkFade" min="0" max="128" step="1">
</div>
<div class="label-box">
<div class="head">
<b>亮部褪色</b>
<span v-text="style.brightFade"></span>
</div>
<input type="range" v-model.number="style.brightFade" min="0" max="128" step="1">
</div>
</div>
</div>
<div class="group">
<div class="head">
<h3>顏色設置</h3>
</div>
<div class="body">
<div class="label-box">
<div class="head">
<b>紫鲜艳度</b>
<span v-text="style.vividU"></span>
</div>
<input type="range" v-model.number="style.vividU" min=".1" max="4" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>青鲜艳度</b>
<span v-text="style.vividV"></span>
</div>
<input type="range" v-model.number="style.vividV" min=".1" max="4" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>紫色偏移</b>
<span v-text="style.shiftU"></span>
</div>
<input type="range" v-model.number="style.shiftU" min="-200" max="200" step="1">
</div>
<div class="label-box">
<div class="head">
<b>青色偏移</b>
<span v-text="style.shiftV"></span>
</div>
<input type="range" v-model.number="style.shiftV" min="-200" max="200" step="1">
</div>
<div class="label-box">
<div class="head">
<b>色彩断层</b>
<span v-text="style.level"></span>
</div>
<input type="range" v-model.number="style.level" min="1" max="255" step="1">
</div>
</div>
</div>
<div class="group">
<div class="head">
<h3>效果設置</h3>
</div>
<div class="body">
<div class="label-box">
<div class="head">
<b>横向偏移</b>
<span v-text="style.shiftX"></span>
</div>
<input type="range" v-model.number="style.shiftX" min="0" max="1000" step="1">
</div>
<div class="label-box">
<div class="head">
<b>纵向偏移</b>
<span v-text="style.shiftY"></span>
</div>
<input type="range" v-model.number="style.shiftY" min="0" max="1000" step="1">
</div>
<div class="label-box">
<div class="head">
<b>信息置换</b>
<span v-text="style.replace"></span>
</div>
<input type="range" v-model.number="style.replace" min="0" max="3" step="1">
</div>
<!--
<div class="label-box">
<div class="head">
<b>信号偏移</b>
<span v-text="style.yuv420Noise"></span>
</div>
<input type="range" v-model.number="style.yuv420Noise" min="1" max="2" step="0.01">
</div>
-->
<!--<div class="label-box">-->
<!--<div class="head">-->
<!--<b>整倍偏移</b>-->
<!--<span v-text="style.yuv420Noise"></span>-->
<!--</div>-->
<!--<input type="range" v-model.number="style.yuv420Noise" min="1" max="8" step="1">-->
<!--</div>-->
<h4>隔行扫描</h4>
<div class="label-box">
<div class="head">
<b>隔行扫描</b>
<span v-text="style.interlaced"></span>
</div>
<input type="range" v-model.number="style.interlaced" min="0" max="8" step="1">
</div>
<div class="label-box">
<div class="head">
<b>隔行扫描周期</b>
<span v-text="style.interlacedLine"></span>
</div>
<input type="range" v-model.number="style.interlacedLine"
min="2" max="8" step="2">
</div>
<div class="label-box">
<div class="head">
<b>隔行扫描亮度差</b>
<span v-text="style.interlacedLight"></span>
</div>
<input type="range" v-model.number="style.interlacedLight" min="0" max="1" step="0.01">
</div>
<h4>漂移</h4>
<div class="label-box">
<div class="head">
<b>横向漂移</b>
<span v-text="style.transposeX"></span>
</div>
<input type="range" v-model.number="style.transposeX" min="0" max="10" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>横向漂移抛物线</b>
<span v-text="style.transposePow"></span>
</div>
<input type="range" v-model.number="style.transposePow"
:disabled="!style.transposeX"
min="1" max="8" step="0.1">
</div>
<div class="label-box">
<div class="head">
<b>横向漂移杂讯</b>
<span v-text="style.transposeNoise"></span>
</div>
<input type="range" v-model.number="style.transposeNoise"
:disabled="!style.transposeX"
min="0" max="2" step="0.01">
</div>
</div>
</div>
<div class="group">
<div class="head">
<h3>质量設置</h3>
</div>
<div class="body">
<div class="label-box">
<div class="head">
<b>像素合并</b>
<span v-text="style.zoom"></span>
</div>
<input type="range" v-model.number="style.zoom" min="1" max="20" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>信号质量</b>
<span v-text="style.quality"></span>
</div>
<input type="range" v-model.number="style.quality" min="0" max="1" step="0.05">
</div>
<div class="label-box">
<div class="head">
<b>信号噪声</b>
<span v-text="style.lightNoise"></span>
</div>
<input type="range" v-model.number="style.lightNoise" min="0" max="500" step="1">
</div>
<div class="label-box">
<div class="head">
<b>胶片颗粒</b>
<span v-text="style.darkNoise"></span>
</div>
<input type="range" v-model.number="style.darkNoise" min="0" max="500" step="1">
</div>
</div>
</div>
<div class="group">
<div class="head">
<h3>變形設置</h3>
</div>
<div class="body">
<div class="label-box" style="padding:0 0 6px 0;">
<b>原始尺寸</b>
<label>
<input type="checkbox" v-model="style.sizeOrigin">原始尺寸处理(性能差)
</label>
</div>
<div class="label-box" style="padding:10px 0;">
<b>画幅比例</b>
<label>
<input type="radio" v-model="style.wide" value="4:3" :disabled="style.sizeOrigin">4:3
</label>
<label>
<input type="radio" v-model="style.wide" value="16:9" :disabled="style.sizeOrigin">16:9
</label>
<label>
<input type="radio" v-model="style.wide" value="21:9" :disabled="style.sizeOrigin">21:9
</label>
<label>
<input type="radio" v-model="style.wide" value="1:1" :disabled="style.sizeOrigin">1:1
</label>
</div>
<div class="label-box" style="padding:10px 0;">
<b>拉伸方案</b>
<label>
<input type="radio" v-model="style.fit" value="cover" :disabled="style.sizeOrigin">填充
</label>
<label>
<input type="radio" v-model="style.fit" value="contain" :disabled="style.sizeOrigin">完整
</label>
<label>
<input type="radio" v-model="style.fit" value="fill" :disabled="style.sizeOrigin">拉伸
</label>
</div>
<div class="label-box">
<div class="label-box">
<div class="head">
<b>比例变形</b>
<span v-text="style.ratio"></span>
</div>
<input type="range" v-model.number="style.ratio"
min="0.5" max="2" step="0.1"
:disabled="style.fit==='fill'">
</div>
</div>
<div class="label-box">
<div class="head">
<b>边缘偏差</b>
<span v-text="style.border"></span>
</div>
<input type="range" v-model.number="style.border" min="0" max="30" step="0.1">
</div>
</div>
</div>
<div class="group">
<div class="head">
<h3>水印設置</h3>
</div>
<div class="body">
<div class="label-box" style="padding:0 0 10px 0;">
<label style="display:inline-block;margin-right:1em;">
<input type="checkbox" v-model="style.watermark">显示蒸汽机水印
</label>
<button class="btn-min" @click="setLogoFromFile"
:disabled="!style.watermark">选择水印</button>
</div>
<div class="label-box">
<div class="head">
<b>水平位置</b>
<span v-text="style.watermarkLeft"></span>
</div>
<input type="range" v-model.number="style.watermarkLeft"
:disabled="!style.watermark"
min="0" max="1" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>垂直位置</b>
<span v-text="style.watermarkTop"></span>
</div>
<input type="range" v-model.number="style.watermarkTop"
:disabled="!style.watermark"
min="0" max="1" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>透明度</b>
<span v-text="style.watermarkAlpha"></span>
</div>
<input type="range" v-model.number="style.watermarkAlpha"
:disabled="!style.watermark"
min="0" max="1" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>盖印比例</b>
<span v-text="style.watermarkSize"></span>
</div>
<input type="range" v-model.number="style.watermarkSize"
:disabled="!style.watermark"
min="0.3" max="1.5" step="0.01">
</div>
<div class="label-box" style="padding:10px 0;">
<label>
<input type="checkbox" v-model="style.styleName">显示预设名
</label>
</div>
<div class="label-box">
<div class="head">
<b>水平位置</b>
<span v-text="style.styleLeft"></span>
</div>
<input type="range" v-model.number="style.styleLeft"
:disabled="!style.styleName"
min="0" max="1" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>垂直位置</b>
<span v-text="style.styleTop"></span>
</div>
<input type="range" v-model.number="style.styleTop"
:disabled="!style.styleName"
min="0" max="1" step="0.01">
</div>
<div class="label-box">
<div class="head">
<b>盖印比例</b>
<span v-text="style.styleSize"></span>
</div>
<input type="range" v-model.number="style.styleSize"
:disabled="!style.styleName"
min="0.3" max="1.5" step="0.01">
</div>
</div>
</div>
<div class="group">
<div class="head">
<h3>其他設置</h3>
</div>
<div class="body">
<div class="label-box" style="padding:4px 0;">
<label>
<input type="checkbox" v-model="style.sharpen">强调线条
</label>
<label>
<input type="checkbox" v-model="style.snow">切断信号
</label>
<label>
<input type="checkbox" v-model="style.invertLight">颠倒黑白
</label>
</div>
<div class="label-box" style="padding:10px 0;">
<b>线条方案</b>
<label>
<input type="radio" v-model="style.convoluteName" value="右倾" :disabled="!style.sharpen">右倾
</label>
<label>
<input type="radio" v-model="style.convoluteName" value="左倾" :disabled="!style.sharpen">左倾
</label>
<label>
<input type="radio" v-model="style.convoluteName" value="桑拿" :disabled="!style.sharpen">桑拿
</label>
<label>
<input type="radio" v-model="style.convoluteName" value="浮雕" :disabled="!style.sharpen">浮雕
</label>
</div>
<!--
<div class="label-box" style="padding:4px 0;">
<label>
<input type="checkbox" v-model="style.none">对比原图
</label>
</div>
-->
</div>
</div>
<div class="group">
<div class="body">
<div class="label-box style-ctrl-box">
<button @click="addStyle" class="btn wire">创建个人预设</button>
<button @click="postStyle" class="btn wire">提交成为公共预设</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="/vue.2.6.11.min.js"></script>
<script src="vaporwave.js"></script>
<script src="styles.js"></script>
<script src="images.js"></script>
<script src="document.js"></script>
</body>
</html>