Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
2129 lines (2093 loc) · 92.9 KB
/
Copy pathindex.html
File metadata and controls
2129 lines (2093 loc) · 92.9 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
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
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Convert PNG, JPEG, WebP, GIF and BMP images to clean SVG vectors in your browser. Remove backgrounds, tune colors and export SVG, PNG, PDF or DXF. No uploads."
/>
<meta name="color-scheme" content="dark" />
<meta name="theme-color" content="#17191d" />
<link rel="canonical" href="https://rastertrace.com/" />
<link rel="icon" type="image/svg+xml" href="./assets/logo-mark.svg?v=1" />
<link rel="icon" href="./favicon.ico?v=2" sizes="any" />
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png?v=2" />
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png?v=2" />
<link rel="apple-touch-icon" href="./apple-touch-icon.png?v=2" />
<link rel="manifest" href="./site.webmanifest" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="rastertrace" />
<meta property="og:title" content="rastertrace - Convert Images to SVG Vectors in Browser" />
<meta
property="og:description"
content="Convert raster images to clean SVG vectors in your browser. Remove backgrounds, tune colors and export SVG, PNG, PDF or DXF. No uploads."
/>
<meta property="og:url" content="https://rastertrace.com/" />
<meta property="og:image" content="https://rastertrace.com/og-image-v2.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="rastertrace - Convert Images to SVG Vectors in Browser" />
<meta
name="twitter:description"
content="Convert raster images to clean SVG vectors in your browser. Remove backgrounds, tune colors and export SVG, PNG, PDF or DXF. No uploads."
/>
<meta name="twitter:image" content="https://rastertrace.com/og-image-v2.png" />
<title>rastertrace - Convert Images to SVG Vectors in Browser</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "rastertrace",
"url": "https://rastertrace.com/",
"description": "Convert PNG, JPEG, WebP, GIF and BMP images to clean SVG vectors in your browser. Remove backgrounds, tune colors and export SVG, PNG, PDF or DXF. No uploads.",
"applicationCategory": "MultimediaApplication",
"operatingSystem": "Any (modern web browser)",
"browserRequirements": "Requires JavaScript and WebAssembly.",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }
}
</script>
<link rel="stylesheet" href="css/styles.css?v=118" />
</head>
<body>
<header class="app-header">
<div class="menubar">
<h1 class="brand" aria-label="rastertrace home">
<img class="brand-mark" src="assets/logo-mark.svg?v=1" alt="" /><span>rastertrace</span>
</h1>
<details class="app-menu">
<summary>File</summary>
<div class="menu-popover">
<button type="button" data-action="open-image">Open image<span>Ctrl+O</span></button>
<button type="button" data-action="open-sample">Open sample image</button>
<hr />
<button type="button" data-action="save-svg" data-result-action disabled>
Save as SVG<span>Ctrl+E</span>
</button>
<button type="button" data-action="copy-svg" data-result-action disabled>
Copy SVG
</button>
<button type="button" data-action="download-png" data-result-action disabled>
Save as PNG
</button>
<button type="button" data-action="download-pdf" data-result-action disabled>
Save as PDF
</button>
<button type="button" data-action="download-dxf" data-result-action disabled>
Save as DXF
</button>
<hr />
<button type="button" data-action="preferences">Preferences</button>
<button type="button" data-action="reset-settings">Reset settings</button>
<button type="button" data-action="manage-presets">Manage profiles</button>
</div>
</details>
<details class="app-menu">
<summary>View</summary>
<div class="menu-popover">
<button type="button" data-action="show-result" data-result-action disabled>
Show result
</button>
<button type="button" data-action="show-source" data-result-action disabled>
Show source
</button>
<button type="button" data-action="show-compare" data-result-action disabled>
Compare
</button>
<button type="button" data-action="rotate-left" data-result-action disabled>
Rotate left
</button>
<button type="button" data-action="rotate-right" data-result-action disabled>
Rotate right
</button>
<button type="button" data-action="invert-image" data-result-action disabled>
Invert colors
</button>
<hr />
<button type="button" data-action="toggle-left-panel">
Profile & colors panel
</button>
<button type="button" data-action="toggle-right-panel">Trace settings panel</button>
<button type="button" data-action="toggle-panels">
Hide or show both<span>Ctrl+\</span>
</button>
<hr />
<button type="button" data-action="zoom-fit" data-result-action disabled>
Fit preview<span>Ctrl+0</span>
</button>
<button type="button" data-action="zoom-actual" data-result-action disabled>
Actual size (1:1)<span>Ctrl+1</span>
</button>
<button type="button" data-action="zoom-in" data-result-action disabled>
Zoom in<span>+</span>
</button>
<button type="button" data-action="zoom-out" data-result-action disabled>
Zoom out<span>-</span>
</button>
</div>
</details>
<details class="app-menu">
<summary>Help</summary>
<div class="menu-popover">
<button type="button" data-action="tracing-guide">Tracing settings</button>
<button type="button" data-action="cleanup-guide">Vector cleanup</button>
<button type="button" data-action="export-guide">SVG export guide</button>
<hr />
<button type="button" data-action="about">About rastertrace</button>
</div>
</details>
</div>
<div class="topbar-actions" role="group" aria-label="Quick actions">
<button class="header-action" type="button" data-action="open-image">
<span class="material-icon icon-folder_open" aria-hidden="true"></span
><span>Open image</span>
</button>
<span class="action-divider" aria-hidden="true"></span>
<div class="export-actions" role="group" aria-label="Export result">
<button
type="button"
id="copy-svg"
class="header-action icon-label-action"
disabled
title="Copy the SVG markup to the clipboard"
>
<span class="material-icon icon-content_copy" aria-hidden="true"></span
><span>Copy</span>
</button>
<button
type="button"
id="download-png"
class="header-action icon-label-action"
disabled
title="Save a PNG at the trace resolution, choosing its name and location"
>
<span class="material-icon icon-image" aria-hidden="true"></span><span>PNG</span>
</button>
<button
type="button"
id="download-pdf"
class="header-action icon-label-action"
disabled
title="Save a vector PDF, choosing its name and location"
>
<span class="material-icon icon-picture_as_pdf" aria-hidden="true"></span
><span>PDF</span>
</button>
<button
type="button"
id="download-dxf"
class="header-action icon-label-action"
disabled
title="Save DXF geometry, choosing its name and location"
>
<span class="material-icon icon-architecture" aria-hidden="true"></span><span>DXF</span>
</button>
<button
type="button"
id="download"
class="header-action primary-action save-action"
disabled
title="Save the SVG, choosing its name and location"
>
<span class="material-icon icon-save" aria-hidden="true"></span><span>Save SVG</span>
</button>
</div>
</div>
</header>
<main id="main">
<div id="error" class="error" hidden>
<p id="error-text" role="alert"></p>
<button type="button" id="error-dismiss" class="button button-secondary">Dismiss</button>
</div>
<!-- Empty state: the drop zone is the whole stage -->
<section id="empty-state" class="stage-empty">
<div id="dropzone" class="dropzone">
<img class="dropzone-mark" src="assets/logo.svg?v=3" alt="" />
<p class="dropzone-title">
<span class="drop-copy">Drop an image here</span
><span class="tap-copy">Choose an image</span>
</p>
<p class="dropzone-hint">
PNG, JPEG, WebP, GIF or BMP. Converted to SVG on your machine; no upload.
</p>
<button type="button" id="pick-file" class="button button-primary">
<span class="material-icon icon-upload_file" aria-hidden="true"></span>Choose image
</button>
<button type="button" id="try-sample" class="button button-ghost">
Try a sample image
</button>
<input
type="file"
id="file-input"
accept=".png,.jpg,.jpeg,.webp,.gif,.bmp"
class="visually-hidden"
aria-label="Choose an image to convert"
/>
</div>
</section>
<!-- Workspace: hidden until an image loads -->
<section id="workspace" class="workspace" data-sheet="colors" hidden>
<!-- Phones show one settings section at a time under the preview. -->
<div class="sheet-tabs" role="group" aria-label="Settings section">
<button type="button" data-sheet-tab="presets" aria-pressed="false">Profile</button>
<button type="button" data-sheet-tab="background" aria-pressed="false">Background</button>
<button type="button" data-sheet-tab="colors" aria-pressed="true">Colors</button>
<button type="button" data-sheet-tab="tracing" aria-pressed="false">Tracing</button>
<button type="button" data-sheet-tab="palette" aria-pressed="false">Palette</button>
<button type="button" data-sheet-tab="export" aria-pressed="false">Export</button>
</div>
<aside id="left-panel" class="controls controls-left" aria-labelledby="left-panel-title">
<div class="rail-head">
<h2 id="left-panel-title" class="rail-title">Profile & colors</h2>
<button
type="button"
id="fold-left"
class="rail-fold"
aria-expanded="true"
aria-controls="left-panel-body"
aria-label="Hide profile, colors and palette"
title="Hide panel (Ctrl+\ for both)"
>
<svg
class="fold-icon"
viewBox="0 0 16 16"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
focusable="false"
>
<rect x="1.5" y="2.5" width="13" height="11" rx="2" />
<path d="M6 2.5v11" />
<path d="M10.5 6 8.5 8l2 2" />
</svg>
</button>
</div>
<div id="left-panel-body" class="rail-body">
<details class="panel" data-panel-key="profile" data-sheet="presets" open>
<summary
title="Purpose-based starting point: sets colors, cleanup, path detail, and output options together. Every control stays editable"
>
<span class="panel-heading"
><span>Profile</span
><span id="profile-summary" class="panel-summary">Custom</span></span
>
</summary>
<div class="panel-body profile-field">
<label for="export-profile" class="visually-hidden">Profile</label>
<select id="export-profile" size="13">
<option value="">Custom</option>
<option value="web">Web optimized (smallest)</option>
<option value="balanced">Balanced</option>
<option value="detail">High detail</option>
<option value="maxDetail">Max detail (smooth)</option>
<option value="pixelExact">Pixel exact</option>
<option value="icon">Icon & logo</option>
<option value="print">Print (spot colors)</option>
<option value="vinyl">Vinyl & cutting (layers)</option>
<option value="monoBlack">Mono stencil (black)</option>
<option value="monoWhite">Mono stencil (white)</option>
<option value="lineArt">Line art (scans)</option>
<option value="laser">Laser stencil (B/W)</option>
</select>
<button
type="button"
id="save-preset"
class="button button-secondary"
title="Save every current setting under a name of your own"
>
Save profile
</button>
</div>
</details>
<details class="panel" data-panel-key="colors" data-sheet="colors" open>
<summary title="How many colors the trace keeps and where they come from">
<span class="panel-heading"
><span>Colors</span
><span id="colors-summary" class="panel-summary">16 colors</span></span
>
</summary>
<div class="panel-body">
<div class="field">
<label
for="preset"
title="Quick color count. Sets Max colors only; every other setting stays as it is"
>Color presets</label
>
<select id="preset">
<option value="">Custom</option>
<option value="2">2 colors</option>
<option value="3">3 colors</option>
<option value="4">4 colors</option>
<option value="6">6 colors</option>
<option value="8">8 colors</option>
<option value="16">16 colors</option>
<option value="32">32 colors</option>
<option value="64">64 colors</option>
<option value="128">128 colors</option>
<option value="256">256 colors (all)</option>
</select>
<label class="choice"
><input type="checkbox" id="auto-detect" checked />
<span
title="On: max colors, smallest shape and merge similar shades are set from each image you open. Changing them yourself, or picking a color preset or most profiles, turns this off so your values carry over to the next image (Balanced, High detail and Max detail keep it on)"
>Auto-detect colors for each image</span
></label
>
</div>
<div class="field">
<label
for="color-source"
title="Trace with the image's own colors, or snap every shape to colors you choose, such as brand colors or stocked inks"
>Color source</label
>
<select id="color-source">
<option value="auto">This image (automatic)</option>
<option value="custom">My colors</option>
</select>
<div id="swatch-field" class="swatch-field" hidden>
<div
id="swatch-list"
class="palette-grid"
role="group"
aria-label="My colors"
></div>
<p id="swatch-empty" class="palette-hint">
Add colors to trace with. Until then the image's own colors are used.
</p>
<div class="color-row">
<input
type="text"
id="swatch-input"
class="swatch-input"
placeholder="#1f2a3b, #ffffff"
aria-label="Colors to add, as hex codes"
spellcheck="false"
autocomplete="off"
/>
<button type="button" id="swatch-add" class="button button-secondary">
Add
</button>
</div>
<div class="color-row">
<button
type="button"
id="swatch-import"
class="button button-secondary"
title="Adobe .ase (Illustrator Swatches panel), GIMP or Inkscape .gpl, or a text list of hex codes"
>
Import file
</button>
<button type="button" id="swatch-clear" class="button button-secondary">
Clear
</button>
</div>
<input type="file" id="swatch-file" accept=".ase,.gpl,.txt,.hex,.css" hidden />
<input type="hidden" id="swatches" value="" />
<p id="swatch-note" class="palette-hint" role="status"></p>
</div>
</div>
<div class="field">
<div class="label-row">
<label
for="colors"
title="Maximum colors in the output. Fewer colors gives simpler, cleaner, smaller SVGs"
>Max colors</label
>
<output id="colors-out" for="colors">All</output>
</div>
<input type="range" id="colors" min="2" max="256" step="1" value="256" />
</div>
<div class="field">
<div class="label-row">
<label
for="layer-diff"
title="Minimum color difference between stacked layers. Raise to merge similar shades into one shape"
>Merge similar shades</label
>
<output id="layer-diff-out" for="layer-diff">16</output>
</div>
<input type="range" id="layer-diff" min="0" max="128" step="1" value="16" />
</div>
<div class="field">
<label class="choice"
><input type="checkbox" id="stencil" />
<span
title="Black and white stencil trace: dark areas become black shapes, everything else drops out. Best for laser cutting, stamps, and silhouettes"
>Stencil (black & white)</span
></label
>
<div class="subfield" id="stencil-threshold-field" hidden>
<div class="label-row">
<label
for="stencil-threshold"
title="Brightness cut-off: pixels darker than this become black shapes. Lower keeps only the darkest areas; raise to pick up midtones"
>Stencil threshold</label
>
<output id="stencil-threshold-out" for="stencil-threshold">128</output>
</div>
<input
type="range"
id="stencil-threshold"
min="1"
max="254"
step="1"
value="128"
/>
</div>
<div class="subfield" id="stencil-ink-field" hidden>
<span class="label-row"><label>Stencil ink</label></span>
<label class="choice"
><input type="radio" name="stencil-ink" value="black" checked />
<span title="Dark areas become black shapes on a transparent background"
>Black on transparent</span
></label
>
<label class="choice"
><input type="radio" name="stencil-ink" value="white" />
<span
title="Dark areas become white shapes on a transparent background, for white ink on dark material"
>White on transparent</span
></label
>
</div>
<label class="choice"
><input type="checkbox" id="grayscale" />
<span title="Convert to shades of gray before tracing">Grayscale</span></label
>
</div>
</div>
</details>
<details class="panel" data-panel-key="palette" data-sheet="palette" open>
<summary title="Change any traced color to a HEX or RGB value. Shapes stay the same">
<span class="panel-heading"
><span>Palette</span
><span id="palette-summary" class="panel-summary">No trace</span></span
>
</summary>
<div class="panel-body">
<div class="color-row">
<button
type="button"
id="palette-pick"
class="button button-secondary"
aria-pressed="false"
title="Click the result to choose a traced color to edit (Esc cancels)"
disabled
>
Pick from result
</button>
<button
type="button"
id="palette-select"
class="button button-secondary"
aria-pressed="false"
title="Select several swatches to merge them into one color. Shift- or Ctrl-click also selects"
disabled
>
Select
</button>
</div>
<p id="palette-hidden-note" hidden>
<span class="material-icon icon-visibility_off" aria-hidden="true"></span>
<span id="palette-hidden-count"></span>
</p>
<div id="palette-grid" class="palette-grid" role="list" hidden></div>
<button
type="button"
id="palette-merge"
class="button button-secondary"
title="Give the selected colors the color of the largest one"
hidden
>
Merge colors
</button>
<p id="palette-hint" class="palette-hint">
Pick a color from the result to edit it. The full palette shows at 32 colors or
fewer.
</p>
<div
id="palette-editor"
class="palette-editor"
role="group"
aria-label="Edit color"
hidden
>
<div class="palette-editor-head">
<span
id="palette-original-swatch"
class="palette-chip"
aria-hidden="true"
></span>
<span
>Original <code id="palette-original-hex" title="Traced color">#000000</code
><span id="palette-original-hidden" hidden>, hidden</span></span
>
<button
type="button"
id="palette-close"
class="button button-secondary palette-close"
aria-label="Close color editor"
>
Close
</button>
</div>
<div class="palette-editor-fields">
<input type="color" id="palette-color" value="#000000" aria-label="New color" />
<label class="palette-field"
><span>HEX</span
><input
type="text"
id="palette-hex"
aria-describedby="palette-error"
value="#000000"
maxlength="7"
spellcheck="false"
autocomplete="off"
/></label>
<label class="palette-field"
><span>R</span
><input
type="number"
id="palette-r"
aria-describedby="palette-error"
min="0"
max="255"
step="1"
value="0"
/></label>
<label class="palette-field"
><span>G</span
><input
type="number"
id="palette-g"
aria-describedby="palette-error"
min="0"
max="255"
step="1"
value="0"
/></label>
<label class="palette-field"
><span>B</span
><input
type="number"
id="palette-b"
aria-describedby="palette-error"
min="0"
max="255"
step="1"
value="0"
/></label>
</div>
<p id="palette-error" class="palette-error" hidden></p>
<button type="button" id="palette-reset" class="button button-secondary">
Reset color
</button>
<button type="button" id="palette-hide" class="button button-secondary">
Hide color
</button>
</div>
<div id="palette-layering-note" class="palette-layering-note" hidden>
<p>Hidden colors reveal the shape beneath in stacked layering.</p>
<button type="button" id="palette-use-cutout" class="button button-secondary">
Use cutout layering
</button>
</div>
<ul id="palette-edits" class="palette-edits" aria-label="Edited colors"></ul>
<button
type="button"
id="palette-reset-all"
class="button button-secondary"
disabled
>
Reset all colors
</button>
</div>
</details>
</div>
</aside>
<aside id="right-panel" class="controls controls-right" aria-labelledby="right-panel-title">
<div class="rail-head">
<h2 id="right-panel-title" class="rail-title">Trace settings</h2>
<button
type="button"
id="reset-settings"
class="button button-ghost rail-action"
title="Restore every control to its default value"
>
Reset
</button>
<button
type="button"
id="fold-right"
class="rail-fold"
aria-expanded="true"
aria-controls="right-panel-body"
aria-label="Hide settings"
title="Hide panel (Ctrl+\ for both)"
>
<svg
class="fold-icon"
viewBox="0 0 16 16"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
focusable="false"
>
<rect x="1.5" y="2.5" width="13" height="11" rx="2" />
<path d="M10 2.5v11" />
<path d="M5.5 6l2 2-2 2" />
</svg>
</button>
</div>
<div id="right-panel-body" class="rail-body">
<!-- The stencil threshold field moves here while the Laser
profile is active: it is that profile's main dial. -->
<div id="stencil-threshold-slot" hidden></div>
<details class="panel" data-panel-key="background" data-sheet="background">
<summary title="Choose how the source background is handled">
<span class="panel-heading"
><span class="panel-step" aria-hidden="true">1</span><span>Background</span
><span id="background-summary" class="panel-summary">Keep background</span></span
>
</summary>
<div class="panel-body">
<div class="field background-mode-field">
<label
for="transparent"
title="Edges: remove everything connected to the image border. Color: remove a color everywhere it appears"
>Background mode</label
>
<select id="transparent">
<option value="">Keep background</option>
<option value="edges">Remove connected from edges</option>
<option value="auto">Remove color (auto-detect)</option>
<option value="custom">Remove color (pick)</option>
</select>
</div>
<div class="conditional-fields">
<div class="subfield" id="knockout-color-field" hidden>
<label
for="knockout-color"
title="Pixels matching this color become transparent"
>Color to remove</label
>
<div class="color-row">
<input type="color" id="knockout-color" value="#ffffff" />
<button
type="button"
id="pick-from-image"
class="button button-secondary"
aria-pressed="false"
title="Click the image to sample the color from the current reduced-color state (Esc cancels)"
>
Pick from image
</button>
</div>
</div>
<div class="subfield" id="contiguous-field" hidden>
<label class="choice"
><input type="checkbox" id="contiguous" />
<span
title="Removes the color only where it connects to the image border, so the same color inside the subject stays"
>Only where connected to edges</span
></label
>
</div>
<div class="subfield" id="enclosed-field" hidden>
<label class="choice"
><input type="checkbox" id="enclosed" />
<span
title="Also removes enclosed background, such as the inside of an O or gaps between shapes. Can also remove subject areas that share the background color"
>Also remove enclosed background</span
></label
>
</div>
<div class="subfield" id="enclosed-size-field" hidden>
<div class="label-row">
<label
for="enclosed-size"
title="Enclosed areas smaller than this many source pixels across stay. Lower it to reach small letter counters; raise it to protect same-color details in the subject"
>Smallest enclosed area</label
>
<output id="enclosed-size-out" for="enclosed-size">16 px</output>
</div>
<input type="range" id="enclosed-size" min="1" max="64" step="1" value="16" />
</div>
<div class="subfield" id="enclosed-max-size-field" hidden>
<div class="label-row">
<label
for="enclosed-max-size"
title="Enclosed areas larger than this many source pixels across stay, such as a blank screen or a white shirt that shares the background color. Far right is no limit"
>Largest enclosed area</label
>
<output id="enclosed-max-size-out" for="enclosed-max-size">No limit</output>
</div>
<input
type="range"
id="enclosed-max-size"
min="8"
max="512"
step="8"
value="512"
/>
</div>
<div class="subfield" id="gradient-field" hidden>
<label class="choice"
><input type="checkbox" id="gradient" />
<span
title="Lets the removal follow a background that fades or changes shade, such as a vignette or lit backdrop. Can creep into low-contrast edges; lower the tolerance if it does"
>Follow gradient background</span
></label
>
</div>
<div class="subfield" id="fuzz-field" hidden>
<div class="label-row">
<label
for="fuzz"
title="How closely pixels must match the removed color. 0 is exact; raise for JPEG noise or gradients"
>Match tolerance</label
>
<output id="fuzz-out" for="fuzz">16</output>
</div>
<input type="range" id="fuzz" min="0" max="255" step="1" value="16" />
</div>
<div class="subfield" id="specks-field" hidden>
<div class="label-row">
<label
for="specks"
title="Removes leftover opaque specks and fills pinholes in the subject smaller than this many pixels across. 0 is off"
>Clean specks</label
>
<output id="specks-out" for="specks">0</output>
</div>
<input type="range" id="specks" min="0" max="16" step="1" value="0" />
</div>
<div class="subfield" id="edge-smooth-field" hidden>
<div class="label-row">
<label
for="edge-smooth"
title="Rounds off jagged steps and small bumps along the cutout edge. Corners round and details thinner than this many pixels disappear. 0 is off"
>Edge smooth</label
>
<output id="edge-smooth-out" for="edge-smooth">0</output>
</div>
<input type="range" id="edge-smooth" min="0" max="8" step="1" value="0" />
</div>
<div class="subfield" id="edge-trim-field" hidden>
<div class="label-row">
<label
for="edge-trim"
title="Peels this many pixels off the cutout boundary to remove leftover fringe. Thin details shrink by the same amount"
>Edge trim</label
>
<output id="edge-trim-out" for="edge-trim">0</output>
</div>
<input type="range" id="edge-trim" min="0" max="16" step="1" value="0" />
</div>
<div class="subfield" id="defringe-field" hidden>
<div class="label-row">
<label
for="defringe"
title="Repaints this many pixels of the cutout boundary with interior colors to hide leftover fringe. Keeps thin details at full size"
>Defringe</label
>
<output id="defringe-out" for="defringe">0</output>
</div>
<input type="range" id="defringe" min="0" max="8" step="1" value="0" />
</div>
</div>
</div>
</details>
<details class="panel" data-panel-key="cleanup" data-sheet="colors" open>
<summary>
<span class="panel-heading"
><span class="panel-step" aria-hidden="true">2</span
><span>Noise cleanup</span></span
>
</summary>
<div class="panel-body">
<div class="field">
<div class="label-row">
<label
for="speckle"
title="Drops traced specks smaller than this many pixels. Raise to remove noise and dust"
>Smallest shape (px)</label
>
<output id="speckle-out" for="speckle">8</output>
</div>
<input type="range" id="speckle" min="0" max="32" step="1" value="8" />
</div>
<div class="field">
<label class="choice"
><input type="checkbox" id="denoise" />
<span
title="Smooths photo noise before color reduction. Softens pixel art and fine texture"
>Denoise (photos; softens pixel art)</span
></label
>
</div>
</div>
</details>
<details class="panel" data-panel-key="tracing" data-sheet="tracing" open>
<summary>
<span class="panel-heading"
><span class="panel-step" aria-hidden="true">3</span><span>Tracing</span
><span id="tracing-summary" class="panel-summary">Spline</span></span
>
</summary>
<div class="panel-body">
<div class="field">
<label
for="upscale"
title="Enlarges the image before tracing for smoother curves. Longest side is capped at 2048 px (4096 with Ultra); larger images are reduced to fit. Ultra is slower and uses much more memory"
>Upscale before tracing</label
>
<select id="upscale">
<option value="1">1× (off)</option>
<option value="2">2×</option>
<option value="3">3×</option>
<option value="4">4×</option>
<option value="auto" selected>Auto (default)</option>
<option value="ultra">Ultra (fit 4096, slow)</option>
</select>
</div>
<fieldset class="field segmented">
<legend title="How traced outlines are drawn">Path mode</legend>
<label class="choice"
><input type="radio" name="mode" value="spline" checked />
<span title="Smooth flowing curves; best for most artwork">Spline</span></label
>
<label class="choice"
><input type="radio" name="mode" value="polygon" />
<span title="Straight line segments; best for hard-edged geometric art"
>Polygon</span
></label
>
<label class="choice"
><input type="radio" name="mode" value="none" />
<span
title="Exact pixel outlines with nearest-neighbor upscaling; best for pixel art"
>Pixel</span
></label
>
</fieldset>
<div class="field">
<div class="label-row">
<label
for="simplify"
title="How closely paths follow the image. Lower keeps more detail and anchor points; higher gives simpler, smoother paths with fewer points. Sets Segment length and Spline splitting under Advanced tracing"
>Simplify</label
>
<output id="simplify-out" for="simplify">4</output>
</div>
<input type="range" id="simplify" min="0" max="6" step="1" value="4" />
</div>
<div class="field">
<div class="label-row">
<label
for="corner-threshold"
title="Angles smoother than this many degrees trace as curves. Lower keeps text and logo corners sharp; raise for flowing curves"
>Corner rounding</label
>
<output id="corner-threshold-out" for="corner-threshold">60</output>
</div>
<input type="range" id="corner-threshold" min="0" max="120" step="1" value="60" />
</div>
<div class="field">
<div class="label-row">
<label
for="straighten"
title="Snap wobbly, bumpy or stair-stepped edges to true straight lines, up to this many source pixels off. Higher values straighten more aggressively; corners and curves larger than the setting are kept"
>Straighten lines</label
>
<output id="straighten-out" for="straighten">1</output>
</div>
<input type="range" id="straighten" min="0" max="16" step="0.5" value="1" />
</div>
<div class="field">
<div class="label-row">
<label
for="smooth-outlines"
title="Smooths pixel-level steps and noise along every edge before tracing, so outlines come out cleaner. Higher values smooth more but round small corners and can thin fine lines. Off in Pixel mode"
>Smooth outlines</label
>
<output id="smooth-outlines-out" for="smooth-outlines">1</output>
</div>
<input type="range" id="smooth-outlines" min="0" max="4" step="1" value="1" />
</div>
<div class="field">
<label
for="hierarchical"
title="Stacked: shapes layer on top of each other (smallest files). Cutout: non-overlapping shapes that tile edge to edge; best for laser cutting, vinyl, and CNC"
>Layering</label
>
<select id="hierarchical">
<option value="stacked">Stacked (default)</option>
<option value="cutout">Mosaic (seam-free cutout)</option>
</select>
</div>
<details class="field advanced">
<summary title="Tracer internals: path precision and curve fitting">
Advanced tracing
</summary>
<div class="subfield">
<div class="label-row">
<label
for="path-precision"
title="Decimal places in path coordinates. 1-2 for small web files; 3-4 for print and fabrication"
>Path precision</label
>
<output id="path-precision-out" for="path-precision">3</output>
</div>
<input type="range" id="path-precision" min="1" max="4" step="1" value="3" />
</div>
<div class="subfield">
<div class="label-row">
<label
for="length-threshold"
title="Curves subdivide until segments are shorter than this. Lower keeps more detail; higher simplifies"
>Segment length</label
>
<output id="length-threshold-out" for="length-threshold">6</output>
</div>
<input
type="range"
id="length-threshold"
min="3.5"
max="10"
step="0.5"
value="6"
/>
</div>
<div class="subfield">
<div class="label-row">
<label
for="splice-threshold"
title="Angle change needed to split a spline. Lower traces more faithful curves; higher simplifies"
>Spline splitting</label
>