-
Notifications
You must be signed in to change notification settings - Fork 58
/
index.html
203 lines (178 loc) · 5.62 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" href="https://javier.xyz/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PINTR - Create plotter-like line drawings from your images</title>
<meta property="og:title" content="PINTR" />
<meta name="twitter:title" content="PINTR" />
<meta name="twitter:card" content="summary_large_image" />
<meta
name="description"
content="Create plotter-like line drawings from your images."
/>
<meta
property="og:description"
content="Create plotter-like line drawings from your images."
/>
<link rel="canonical" href="https://javier.xyz/pintr" />
<meta property="og:url" content="https://javier.xyz/pintr" />
<meta property="og:image:width" content="1600" />
<meta property="og:image:height" content="900" />
<meta property="og:image" content="https://javier.xyz/pintr/pintr.jpg" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="app">
<div class="flex">
<h1>PINTR</h1>
<input id="inputImageFile" type="file" />
<button id="inputImageButton" type="file">New image</button>
</div>
<div class="inline">
<div class="padding">
<canvas id="draw"></canvas>
</div>
<div class="srcimage-container padding">
<div id="srcImg"></div>
<div class="label">Source</div>
</div>
</div>
<canvas id="src" style="display: none"></canvas>
<div class="input-container">
<div class="input">
<label for="density">Density</label>
<input
type="range"
data-start-drawing
id="density"
min="0"
max="100"
value="50"
/>
</div>
<div class="input">
<label for="contrast">Contrast</label>
<input
type="range"
data-start-drawing
id="contrast"
min="0"
max="100"
value="50"
/>
</div>
<div class="input">
<label for="definition">Definition</label>
<input
type="range"
data-start-drawing
id="definition"
min="0"
max="100"
value="50"
/>
</div>
<div class="input">
<label for="singleLine">Single Line</label>
<input
type="range"
data-start-drawing
class="toggle"
id="singleLine"
min="0"
max="1"
value="1"
/>
</div>
<div class="input">
<label for="strokeWidth">Stroke width</label>
<input
type="range"
data-start-drawing
id="strokeWidth"
step="0.25"
min="0.5"
max="5"
value="1.5"
/>
</div>
</div>
<div class="flex">
<button id="download">Download PNG</button>
<button id="downloadSvg">Download SVG</button>
</div>
<div class="instructions">
<strong>1.</strong>Select an image, images with a face, white or light
backgrounds and good contrast work better. <strong>2.</strong>Play with
the controls. <strong>3.</strong>Download. Your pictures never leave
your computer. More information and source available on
<a href="https://github.com/javierbyte/pintr">Github</a>.
</div>
<div class="instructions">
Created by
<a href="https://javier.xyz">javierbyte</a>. This site uses
<a href="https://brutalita.com">Brutalita Sans</a>. Follow me on
<a href="https://x.com/javierbyte">X</a> to stay updated.
</div>
<div class="experimental--smooth-svg">
<div class="instructions">Other Exports:</div>
<div class="input-container">
<div class="input">
<label for="makeSmoothSvg">Smooth SVG</label>
<input
data-start-drawing
type="range"
class="toggle"
id="makeSmoothSvg"
min="0"
max="1"
value="0"
/>
</div>
</div>
<div
class="padding experimental--smoth-svg--container--warning"
style="display: none"
>
Smooth SVG is only available for "single line" drawings.
</div>
<div class="experimental--smoth-svg--container">
<div class="input-container">
<div class="input">
<label for="smoothingAmount">Smoothing Amount</label>
<input
type="range"
id="smoothingAmount"
min="0"
max="100"
value="50"
/>
</div>
</div>
<div class="padding">
<div class="label">Smooth SVG</div>
<div class="smooth-svg-container"></div>
</div>
<button id="downloadSmoothSvg">Download SVG</button>
</div>
</div>
<div class="loading"><span>Loading...</span></div>
</div>
<script type="module" src="main.ts"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-M2FT27FXS2"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-M2FT27FXS2');
</script>
</body>
</html>