-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiple.html
More file actions
53 lines (47 loc) · 1.32 KB
/
multiple.html
File metadata and controls
53 lines (47 loc) · 1.32 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
<html>
<head>
<title>Multiple Filters</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="data">
<div class="flex">
<div id="original" class="c1"></div>
<div id="target" class="c1"></div>
<div id="font" class="c1"></div>
</div>
<div class="flex">
<div class="c1"></div>
<div class="c1" id="result"></div>
<div class="c1"></div>
</div>
</div>
<script type="module">
'use strict';
import * as Base from './js/_base.js'
import { Public } from './js/_config.js'
import { Helpers } from './js/_helpers.js'
const W = 500
const H = 500
Helpers.start(); // ( optional ) start the clock if you want to record runtime
// call the Base class
let test = new Base.Base()
// create and reference some canvases
let i = test.canvas(document.getElementById("original"), W, H)
let j = test.canvas(document.getElementById("target"), W, H)
// set an image to load
test.load(['images/mary.png'])
.then(function(images){
test.draw(i,images[0].img)
.getData(i)
.reduceColor(i,3)
.FSDither(i,10)
.nearestPixel(i,5)
.drawBuffer(j)
.done('#result',"Finished!!!!")
})
</script>
</body>
</html>