Repository navigation
PNG and JPG pictures for the icon tag and the import (traced to an outline) #359
plazmabokor
started this conversation in
Ideas
Replies: 3 comments
|
@plazmabokor, yes, please, and thank you for asking first.
Three PRs as you describe them suits me. |
0 replies
|
@plazmabokor, all three parts are in 1.75.0: the tracer, the icon tag with PNG and JPG, and the import window with pictures 50 mm wide. Thank you for building it in three pieces that each could be tested on its own. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
After the icon tag (#225) I tried a logo from the web. It was an SVG with nothing in it but a PNG picture (Inkscape had put the bitmap in as an
<image>), and layerling said "The SVG file refers to external files". Most logos people have at hand are PNG or JPG, so I would like layerling to trace a picture itself: the dark part of it (or the light part, for a white logo on black) becomes a closed outline, and from there it goes the way of an SVG.I would do it in three PRs, so each can be tested on its own:
rasterTrace.ts: the pixels of a PNG or JPG in, an SVG with one filled path out. The outline runs between the pixels (marching squares), short straight runs become one line, specks are left out, transparent pixels are never part of the shape, and the line is straightened until it has at most 1200 pieces, so the CAD kernel builds it quickly. No new dependency, about 300 lines, with unit tests (npm test).Before I go on, a few questions, so nothing has to be written twice:
All reactions