-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
30 lines (27 loc) · 943 Bytes
/
Copy pathindex.html
File metadata and controls
30 lines (27 loc) · 943 Bytes
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
<!DOCTYPE html>
<html lang="zh">
<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">
<title>图片转字符串轮廓输出</title>
<script src="./core.js"></script>
</head>
<body>
<img src="./github-mark.png" alt="原始图片" style="width:400px;display:block;">
<canvas id="canvas"></canvas>
<pre class="res" style="transform: scale(.4);transform-origin: left top;"></pre>
<script>
let logImg = new logImage({
imagePath: "./github-mark.png",
lightFill: "x", //明亮区域(yuv的y >= 190)填充内容
darkFill: " ", //幽暗区域填充内容
});
logImg.print().then((res) => {
document.querySelector(".res").innerHTML = res;
}).catch(err => {
console.log(err)
});
</script>
</body>
</html>