Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to preserve small elements? #46

Open
EvansPM opened this issue Jun 19, 2021 · 0 comments
Open

How to preserve small elements? #46

EvansPM opened this issue Jun 19, 2021 · 0 comments
Labels

Comments

@EvansPM
Copy link

EvansPM commented Jun 19, 2021

Using Autotrace version 0.40.0 under Linux, with -centerline option i'm not able to preserve small elements like dots which are not noise and was clearly visible on the input bitmap image.

bitmap image (jpeg version for github)
input

Svg code:

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="1920" height="1305" version="1.1" xmlns="http://www.w3.org/2000/svg"><path style="stroke:#000000; fill:none;" d="M1273 204L1274 204M1152 206L1153 207M1014 214L1015 215M754 232L755 233M1489 280C1479.53 316.61 1487.32 359.132 1490.83 396C1492.2 410.382 1489.55 428.361 1493 442M651 289L652 289M504 303C504 320.352 507.709 319.703 523 324M1377 311C1368.97 343.571 1366.67 377.746 1369.83 411C1370.75 420.706 1369.23 431.63 1372 441M1171 322C1194.18 321.522 1216.55 315 1240 315C1245.1 315 1260.86 314.293 1264.44 317.527C1268.25 320.976 1266.74 328.473 1267.17 333C1268.47 346.666 1270.09 360.31 1271.09 374C1272.22 389.383 1274.64 404.562 1275.01 420C1275.15 425.721 1276.82 431.584 1273.84 436.957C1269.58 444.617 1257.78 446.83 1250 448.651C1226.18 454.224 1203 455.354 1180 447M505 320L502 325L492 324M1018 338C1032.27 335.057 1046.04 331.369 1060 327.202C1064.96 325.721 1072.99 322.405 1077.96 325.029C1087.17 329.893 1084 347.5 1084 356C1084 386.431 1089 416.562 1089 447M503 326L504 340M755 441C735.419 416.31 730.204 381.561 744.442 353C754.478 332.869 786.121 317.207 804.826 336.105C827.555 359.068 825.814 403.158 814.446 431C809.041 444.239 795.957 466.16 779 458M892 347C908.596 342.695 939.583 328.125 955.896 338.367C966.544 345.053 963.127 360.658 963.004 371C962.658 400.089 961.353 430.146 965 459M1395 372L1444 368.594L1486 367M1190 382C1208.04 385.349 1228.93 383.284 1247 381M430 392L454 392M535 397L563 396M607 398L608 399M493 428L498.43 447.678L512 448M497 448C494.691 453.67 495.264 463.127 497 469M473 450L495 450M547 602C548.275 606.538 547.54 613.535 549.603 617.487C552.826 623.658 564.68 621.672 570 621M548 620C544.94 624.989 539.279 624.02 534 625M557 622L553 639C555.972 635.827 557.825 634.149 556 630M548 625L552 632M553 640L552 641M1443 674L1441 676M907 681L914 681M790 682L789 683M1036 684L1026 685M1551 684L1552 684M477 687L502 688M605 686L631 687M552 733C553.489 744.783 556.371 747.333 566 754C560.67 760.716 555.28 765.182 558 774M552 746C553.067 749.646 554.241 750.986 558 750M551 750C548.954 756.962 542.932 755.363 537 756M567 754L571 752M550 755L557 765M548 756L556 767M1051 789C1064.28 783.85 1077.92 778.064 1092 775.464C1096.72 774.592 1103.65 772.836 1107.9 775.742C1118.16 782.771 1111.49 804.719 1111.04 815C1109.32 854.236 1113 892.864 1113 932M900 805C917.247 800.153 936.283 797.173 954 794.424C960.755 793.376 969.678 791.212 975.982 794.938C986.045 800.888 984.83 822.731 986.286 833C991.625 870.66 992.314 907.106 992 945M784 794.464C811.286 789.641 826.309 817.004 827.014 841C827.85 869.47 826.833 898.615 811.648 924C808.709 928.914 804.132 932.476 800.684 937C791.692 948.797 785.067 958.973 769 961.56C734.847 967.059 723.015 935.881 719.714 908C714.528 864.186 733.982 803.305 784 794.464M1495 796L1496.66 883L1492.29 912L1490 957M1197 802C1214.72 802 1232.31 801 1250 801C1255.73 801 1265.73 799.102 1270.77 802.179C1277.31 806.167 1274.76 819.641 1275.04 826C1275.59 838.646 1277 851.327 1277 864C1277 868.193 1278.27 875.02 1275.97 878.725C1273.88 882.104 1268.14 883.58 1265 886C1273.43 893.972 1278 892.187 1278 881M1375 815L1374 959M1614 839L1615 839M1229 881C1239.51 887.613 1253.03 887.512 1265 886M1486 881L1486 886L1484 884M1485 892L1482 885L1484 884M1397 893L1446 890.039L1481 886M1488 886L1489 886M1479 888L1484 891M1487 889L1494 896M1278 893C1277.99 906.141 1279.72 933.141 1269.87 942.856C1261.66 950.938 1246.65 951 1236 951M1519 998L1520 999M1312 1004L1313 1005M1416 1007L1417 1008"/></svg>

Svg look like this:
image

command:

autotrace -centerline -input-format bmp -output-format svg -output-file output.svg input.bmp

i tryed all options to see if i can make the dot appair but without success, it's look like i should play with despeckle-tightness and despeckle-level.

By the way the "header" of the output.svg look not valide because not viewable on browser, originally my file starts with this:

<?xml version="1.0" standalone="yes"?>
<svg width="1920" height="1305">

i wrote a script to update that every time autotrace finish. i did not see this reported as issue, weird because it's the first thing you see when using it or may be it's from me...

@EvansPM EvansPM changed the title How to preserce small elements? How to preserve small elements? Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants