forked from rilden/tiledpalettequant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
157 lines (154 loc) · 5.52 KB
/
index.html
File metadata and controls
157 lines (154 loc) · 5.52 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="stylesheet" href="style.css">
<title>Tiled Palette Quantization</title>
</head>
<body id="body">
<img id="source_img" src="carina-nebula.png" alt="source image">
<table>
<tr>
<td><label for="image_selector">Input image:</label></td>
<td><input type="file" id="image_selector" accept="image/*"></td>
</tr>
<tr>
<td><label for="tile_width">Tile width</label></td>
<td><input type="number" id="tile_width" min="1" max="32" step="1" value="8"></td>
</tr>
<tr>
<td><label for="tile_height">Tile height</label></td>
<td><input type="number" id="tile_height" min="1" max="32" step="1" value="8"></td>
</tr>
<tr>
<td><label for="palette_num">Palettes:</label></td>
<td><input type="number" id="palette_num" min="1" max="16" step="1" value="4"></td>
</tr>
<tr>
<td><label for="colors_per_palette">Colors per palette:</label></td>
<td><input type="number" id="colors_per_palette" min="2" max="256" step="1" value="16"></td>
</tr>
<tr>
<td><label for="bits_per_channel">Bits per channel:</label></td>
<td><input type="number" id="bits_per_channel" min="2" max="8" step="1" value="5"></td>
</tr>
<tr>
<td><label for="fraction_of_pixels">Fraction of pixels:</label></td>
<td><input type="number" id="fraction_of_pixels" min="0.01" max="10" step="any" value="0.1"></td>
</tr>
<tr>
<td><label for="palette_mode">Palette mode:</label></td>
<td>
<input type="radio" id="palette_generate" name="palette_mode" value="generate" checked>
<label for="palette_generate">Generate from image</label>
<br>
<input type="radio" id="palette_custom" name="palette_mode" value="custom">
<label for="palette_custom">Use custom palette (.pal,.json,.txt):</label>
<input type="file" id="palette_file" accept="image/*,.pal,.json,.txt">
</td>
</tr>
</table>
<fieldset>
<legend>Color index zero behaviour</legend>
<table>
<tr>
<td>
<input type="radio" id="unique" name="color_zero" value="unique" checked>
<label for="unique">unique</label>
</td>
</tr>
<tr>
<td>
<input type="radio" id="shared" name="color_zero" value="shared">
<label for="shared">shared color:</label>
<input type="color" id="shared_color" value="#000000" aria-label="shared color">
</td>
</tr>
<tr>
<td>
<input type="radio" id="transparent_from_transparent" name="color_zero" value="transparent_from_transparent">
<label for="transparent_from_transparent">transparent, from transparent pixels</label>
</td>
</tr>
<tr>
<td>
<input type="radio" id="transparent_from_color" name="color_zero" value="transparent_from_color">
<label for="transparent_from_color">transparent color:</label>
<input type="color" id="transparent_color" value="#ff00ff" aria-label="transparent color">
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Dithering</legend>
<table>
<tr>
<td>
<input type="radio" id="dither_off" name="dither" value="dither_off" checked>
<label for="dither_off">disabled</label>
</td>
</tr>
<tr>
<td>
<input type="radio" id="dither_fast" name="dither" value="dither_fast">
<label for="dither_fast">fast</label>
</td>
</tr>
<tr>
<td>
<input type="radio" id="dither_slow" name="dither" value="dither_slow">
<label for="dither_slow">slow</label>
</td>
</tr>
<tr>
<td><label for="dither_weight">Dither weight:</label></td>
<td><input type="number" id="dither_weight" min="0.01" max="1" step="any" value="0.5"></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Dither pattern</legend>
<table>
<tr>
<td>
<input type="radio" id="dither_diagonal4" name="dither_pattern" value="dither_diagonal4" checked>
<label for="dither_diagonal4">diagonal4</label>
</td>
<td>
<input type="radio" id="dither_diagonal2" name="dither_pattern" value="dither_diagonal2">
<label for="dither_diagonal2">diagonal2</label>
</td>
</tr>
<tr>
<td>
<input type="radio" id="dither_horizontal4" name="dither_pattern" value="dither_horizontal4">
<label for="dither_horizontal4">horizontal4</label>
</td>
<td>
<input type="radio" id="dither_horizontal2" name="dither_pattern" value="dither_horizontal2">
<label for="dither_horizontal2">horizontal2</label>
</td>
</tr>
<tr>
<td>
<input type="radio" id="dither_vertical4" name="dither_pattern" value="dither_vertical4">
<label for="dither_vertical4">vertical4</label>
</td>
<td>
<input type="radio" id="dither_vertical2" name="dither_pattern" value="dither_vertical2">
<label for="dither_vertical2">vertical2</label>
</td>
</tr>
</table>
</fieldset>
<div>
<button type="button" id="quantizeButton">Quantize</button>
<progress id="progress" max="100" value="0"></progress>
</div>
<div id="quantized_images">
</div>
<script type="module" src="script.js"></script>
</body>
</html>