Image tracing for plotters
Find a file
2025-05-02 17:50:24 +02:00
source Refactor 2025-05-02 17:50:24 +02:00
test_images Offset Perlin noise on each path to remove visible pattern 2025-05-02 17:48:18 +02:00
.gitignore Initial commit 2025-04-29 19:10:09 +02:00
dub.json Initial commit 2025-04-29 19:10:09 +02:00
dub.selections.json Initial commit 2025-04-29 19:10:09 +02:00
LICENSE.md Initial commit 2025-04-29 19:10:09 +02:00
README.adoc Initial commit 2025-04-29 19:10:09 +02:00

= linedraw
Mykolas Bamberg <m.a.bamberg.dev@proton.me>
:source-highlighter: pygments
:hide-uri-scheme:
:hardbreaks-option:

https://github.com/LingDong-/linedraw[`LingDong-/linedraw`] algorithm implemented in D

== Usage

----
    ./linedraw [OPTION]... INPUT OUTPUT

Arguments:
-c  --contour Contour detail, 0 to disable
-s    --hatch Hatch scale, 0 to disable
-n    --noise Noise scale, 0 to disable
-w    --width Stroke width
-o --optimize Optimize Route
-h     --help This help information.
----

== Build

https://wiki.dlang.org/LDC[LDC] / https://wiki.dlang.org/DMD[DMD] and https://dub.pm/[DUB] are required.

[source,bash]
----
$ dub build --compiler=ldc2 -f -b release-nobounds
----

== Examples

[source,bash]
----
$ ./linedraw -o -s 20 -c 20 -n 4 test_images/mandelbrot.bmp test_images/mandelbrot.svg
----

[cols="1a,1a",frame=none,grid=none]
|===
|*Source*

image::test_images/mandelbrot.bmp[]
|*Traced*

image::test_images/mandelbrot.svg[]
|===

[source,bash]
----
$ ./linedraw -c 5 -n 4 -w 2 -s 14 -o test_images/antennas.png test_images/antennas.svg
----

[cols="1a,1a",frame=none,grid=none]
|===
|*Source*

image::test_images/antennas.png[]
|*Traced*

image::test_images/antennas.svg[]
|===