Giter Club home page Giter Club logo

autotrace's Introduction

Coverity passed Build status on Linux Build status on macOS

AutoTrace

AutoTrace is a utility for converting bitmaps into vector graphics.

Features

  • tracing outline and midline
  • color reduction and despeckling
  • supports a lot of input and output formats

Licenses

The program can be used under the GNU General Public License (GPL), either version 2 of the License, or (at your option) any later version.

The input and output functions (input-*.[ch] and output-*.[ch]) can also be used under the GNU Lesser General Public License (LGPL), either version 2.1 of the License, or (at your option) any later version.

Some of code was partially derived from limn of GNU fontutils. However, almost all code has been rewritten.

Platforms

The program was tested using GNU/Linux, HP-UX, Solaris, Windows 98, Windows NT, Windows 2000, macOS, and OS/2 4.0. It compiles with GCC, Borland C++ Builder, Visual C++, and many other compilers.

If you use Visual C++ 6.0 for compilation be sure to have at least SP 5 otherwise you could get memory access violations due to a bug in earlier versions.

Requirements

AutoTrace can be compiled standalone, then it can import pnm, pbm, pgm, ppm, bmp, and tga files. If you have installed libpng you can also read png files and with ImageMagick or GraphicsMagick a very broad range of input formats is available.

You will need at least libpng 1.0.6 and ImageMagick 5.2.1. Most output formats like dxf, emf, eps, ai, er, fig, svg, epd, dr2d, and sk are directly integrated in AutoTrace, but if you need swf export you need to install Ming. Also you can export to the p2e format. This format can be converted by pstoedit to a large number of other formats. If you have installed the latest pstoedit (3.32 or newer), AutoTrace uses pstoedit directly. However, direct pstoedit support is not stable enough. See INSTALL file for more detail.

Installation

See the file INSTALL.

Usage

AutoTrace comes in two parts: a command-line program and a library.

Here are the options you can use in the command-line program:

Usage: autotrace [options] <input_file_name>
Options:<input_file_name> must be a supported image file.
  You can use '--' or '-' to start an option.
  You can use any unambiguous abbreviation for an option name.
  You can separate option names and values with '=' or ' '.

-background-color <hexadecimal>: the color of the background that should
    be ignored, for example FFFFFF; default is no background color.

-centerline: trace a character's centerline, rather than its outline.

-charcode <unsigned>: code of character to load from GF font file.

-color-count <unsigned>: number of colors a color bitmap is reduced to,
    it does not work on grayscale, allowed are 1..256;
    default is 0, that means no color reduction is done.

-corner-always-threshold <angle-in-degrees>: if the angle at a pixel is
    less than this, it is considered a corner, even if it is within
    `corner-surround' pixels of another corner; default is 60.

-corner-surround <unsigned>: number of pixels on either side of a
    point to consider when determining if that point is a corner;
    default is 4.

-corner-threshold <angle-in-degrees>: if a pixel, its predecessor(s),
    and its successor(s) meet at an angle smaller than this, it's a
    corner; default is 100.

-despeckle-level <unsigned>: 0..20; default is 0: no despeckling.

-despeckle-tightness <real>: 0.0..8.0; default is 2.0.

-dpi <unsigned>: The dots per inch value in the input image, affects scaling
    of mif output image


-error-threshold <real>: subdivide fitted curves that are off by
    more pixels than this; default is 2.0.

-filter-iterations <unsigned>: smooth the curve this many times
    before fitting; default is 4.

-input-format: Available formats: ppm, png, pbm, pnm, bmp, tga, pgm, gf.

-help: print this message.

-line-reversion-threshold <real>: if a spline is closer to a straight
    line than this, weighted by the square of the curve length, keep it a
    straight line even if it is a list with curves; default is .01.

-line-threshold <real>: if the spline is not more than this far away
    from the straight line defined by its endpoints,
    then output a straight line; default is 1.

-list-output-formats: print a list of supported output formats to stderr.

-list-input-formats: print a list of supported input formats to stderr.

-log: write detailed progress reports to <input_name>.log.

-noise-removal <real>:: 0.0..1.0; default is 0.99.

-output-file <filename>: write to <filename>

-output-format <format>: use format <format> for the output file. Available formats:
    rpl, tk, cfdg, xfig, plot, svg, plot-svg, gschem, gmfa, text, epd, tek, rib, sk, plot-tek, gmfb, pcl, txt, asy, plot-pcl, tex, gnuplot, cairo, dat, plot-hpgl, lwo, pcb, xml, dr2d, pov, dxf_14, eps, tfig, mp, meta, java1, hpgl, ai, cgm, pdf, latex2e, ps2ai, p2e, java2, pic, svm, plot-cgm, plot-ai, plt, noixml, vtk, tgif, idraw, fig, emf, plot-fig, kil, er, m, dxf, obj, ugs, pcbfill, mif, mma, java, gcode, c, dxf_s, ild, mpost, pcbi

-preserve-width: preserve line width prior to thinning.

-remove-adjacent-corners: remove corners that are adjacent.

-tangent-surround <unsigned>: number of points on either side of a
    point to consider when computing the tangent at that point; default is 3.

-report-progress: report tracing status in real time.

-debug-arch: print the type of cpu.

-debug-bitmap: dump loaded bitmap to <input_name>.bitmap.ppm or pgm.

-version: print the version number of this program.

-width-weight-factor <real>: weight factor for fitting the linewidth.


You can get the source code of autotrace from 
https://github.com/autotrace/autotrace

The library is named libautotrace. To learn about the usage of the library see autotrace.h. Here is a sample program that uses libautotrace. To compile, invoke the following commands (on POSIX):

gcc sample.c `pkg-config --libs autotrace` `pkg-config --cflags autotrace`

/* sample.c */
#include <autotrace/autotrace.h>

int main()
{
  char * fname = "img/triangle.png";
  at_fitting_opts_type * opts = at_fitting_opts_new();
  at_input_read_func rfunc = at_input_get_handler(fname);
  at_bitmap_type * bitmap ;
  at_splines_type * splines;
  at_output_write_func wfunc = at_output_get_handler_by_suffix("eps");

  bitmap = at_bitmap_read(rfunc, fname, NULL, NULL, NULL);
  splines = at_splines_new(bitmap, opts, NULL, NULL);
  at_splines_write(wfunc, stdout, "", NULL, splines, NULL, NULL);
  return 0;
}

GUI Frontend

Frontline, a Gtk+/Gnome-based GUI frontend, was under development until 2002. See https://github.com/autotrace/frontline

More Information

See https://github.com/autotrace/autotrace

Contribution

Programmers wanted!!!

See the issue tracker, or the TODO file and contact the author.

Author

Martin Weber ([email protected])

autotrace's People

Contributors

biswa96 avatar collord avatar dependabot[bot] avatar dscho avatar edwardthelegend avatar hanmertens avatar hvdijk avatar jnweiger avatar khaledhosny avatar kleinerm avatar lemenkov avatar lgtm-migrator avatar limburgher avatar martweb1 avatar masatake avatar matthewpruett avatar mtasaka avatar nicolas-raoul avatar openvdb-devteam avatar ryandesign avatar sachac avatar uglygus avatar xbytemx avatar yarda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autotrace's Issues

How to preserve small elements?

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...

Review patches from Martin Weber

@lemenkov I am in contact with the original author Martin Weber. He sends me patches
for fixes he had done in the meantime.

It is hard for me to review his fixes, some might just work with our master, as they are, some others change things we/you also changed.

I am creating branches for every zip or diff he sends me.

No compile attempt made yet.

autotrace(1) says -background-color defaults to none, but it's FFFFFF for -centerline

autotrace(1) says

   -background-color hexvalue
          Employ the color specified by the hexadecimal code hexcode as
          the background that should be ignored, for example FFFFFF
          (default: no background color).

   -centerline
          Trace an object's centerline (default: employ its outline).

https://github.com/autotrace/autotrace/blob/master/src/autotrace.c#L282 suggests that with -centerline a -background-color is used if given, fine, but otherwise it defaults to FFFFFF rather than the 'no background color' documented.

how to use on windows

Hi. I am on a Windows 10 laptop, 64 bit. I downloaded the binary for win 64 using the link referenced in the INSTALLATION file. I also see and understand the command syntax from your main page.

But where do I put these commands? I tried autotrace -help in powershell to no avail. And I tried to click the .exe file in the Autotrace folder after installing, but a window quickly pops up then goes away.

Anyone's help with this would be appreciated.

Autotrace -centerline option gives segmentation fault

With the help of @jnweiger and his autotrace fork I have been able to build autotrace for OSX 10.11 and 10.13.

It works with the following command:

autotrace -output-file test.svg -output-format svg -report-progress test_image.bmp

However, if I use the `-centerline' option:

autotrace -centerline -output-file test.svg -output-format svg -report-progress test_image.bmp

It gives me the following errors:

test_image.bmp|Magick: abort due to signal 11 (SIGSEGV) "Segmentation Fault"...
[1]    11733 abort      autotrace -centerline -output-file test.svg -output-format svg

autotrace-0.40.0-20200219-MacOS gives Illegal instruction: 4 on MacOS <10.13

As the issue title says, your autotrace-0.40.0-20200219-MacOS binary doesn't run on older MacOS systems (tested with El Capitan aka MacOS 10.11.6) and will give an "Illegal instruction: 4"! - On a MacOS Mojave (10.14.6) it will work and run instead. As far as I've seen this might be related to the used High Sierra SDK 10.13 to compile the whole.

Another point when building/recompiling your sources is that GraphicsMagick usage, which usually isn't needed at all here when using instead ImageMagick 6 (see: https://github.com/ImageMagick/ImageMagick6), which BTW includes "magick/api.h" and everything other relevant for building autotrace.

When using and linking against ImageMagick 6 autotrace works flawlessly under El Capitan here too.

Is it possible to get centerline from a vector?

If starting from an EPS input file to get centerline, I have to convert EPS to bitmap and then use autotrace with -centerline. I think it is overkill.

Since autotrace has the possibility of outputting both centerline and outline, I believe it should be technically possible to convert outlines to centerline too.

It is, of course, trivial for the advanced purpose of autotrace, but I have not seen any program for converting outlines to centerline.

Empty output with centerline

autotrace\autotrace.exe -centerline -output-file lego_6.svg -output-format svg lego_5.tga
lego_5.zip

generates empty 0byte output file.
AutoTrace version 0.40.0.

Without -centerline it generates output.

Segmentation fault (core dumped)

When the bitmap image contains at least 3 lines on the edge of the image, even if there is something in the middle of the image, the -centerline fails with:

Segmentation fault (core dumped)

Image to reproduce issue:
frame1 bmp
There is black lines on top, left and bottom borders.

deb package built by travis does not work wit ubuntu 18.04

Travis runs Ubuntu 16.04 - the imagemagick version there is incompatible with Ubuntu-18.04

  • we could build a autotrace-mini package --without-magick, that should work on all Debian and Ubuntu systems.
  • we could convert .travis-ci.yml to matrix syntax and firing up docker containers. That should also help to disentangle the current linux || osx hacks.
  • static linking is not possible as libpstoedit.a is missing in ubuntu-18.04's libpstoedit-dev package.

Workaround: https://github.com/jnweiger/autotrace/releases has an autotrace_0.40.0-20180903-ubuntu1804_all.deb package.

[FR] add resize option

Add resize options, same as potrace has:

-W dim, --width dim
set the width of output image (before any rotation and margins). If only one of width and height is specified, the other is adjusted accordingly so that the aspect ratio is preserved.

-H dim, --height dim
set the height of output image. See -W for details.

http://potrace.sourceforge.net/potrace.1.html
e.g. autotrace -H 10.5cm

svg has to be modified from:
<svg width="780" height="1110" xmlns="http://www.w3.org/2000/svg">

to (need to add viewBox with original units)
<svg width="calc" height="10cm" viewBox="0 0 780 1110" preserveAspectRatio="xMinYMin meet" xmlns="http://www.w3.org/2000/svg"

sudo make install fails

  ./autogen.sh
  ./configure
  make
  make check
  ./autotrace
     //works locally
  sudo make install 

cd ..
autotrace
/usr/bin/autotrace: error: '/usr/bin/.libs/autotrace' does not exist
This script is just a wrapper for autotrace.
See the libtool documentation for more information.

/usr/local/bin/autotrace
/usr/local/bin/autotrace: error while loading shared libraries: libautotrace.so.3: cannot open shared object file: No such file or directory

Keep centerline only

Using Inkscape on this input file gives me the centerline, but I'm unable to do the same with the command line version of autotrace

E008

Screenshot 2022-05-08 at 09 57 52

autotrace --background-color=FFFFFF --centerline --despeckle-level=10 --dpi=300  --output-file=test.svg -log -error-threshold=1  E008.png

gives me this
Screenshot 2022-05-08 at 09 59 16

Have I missed an option somewhere?

autotrace 18.04 deb fails on PNGs with "invalid chunk type"

autotrace --centerline --output-format svg --background-color ffffff --color-count 2 --preserve-width watch.png > watch.svg
[DB][92][E3][28]: invalid chunk type

I'm using the Ubuntu 18.04 deb in #19 (comment) because the releases deb doesn't work on 18.04 (as per issue #12). It successfully converts PPM files, though, so it's not broken; perhaps this is a library issue of some kind, but I don't really understand. It might be useful to build once as a snap and then distribute that way so library problems don't occur on upgrades?

Cannot be directly compiled in Visual Studio

Because of the introduction of glib the code can no longer be compiled in Microsoft Visual Studio as it was with version 0.31. Would be great if the code could be adopted by define statements so that this would be possible again without having to install and compile against glib.

"Completely wrong" -input-format handling

(i hope i'm in the right bug db...)

uname -a
Linux st3v3 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
autotrace -version
AutoTrace version 0.31.1.

autotrace's handling of -input-format seems to be completely hosed. As input i have a PNG file:

autotrace -output-file x.svg -input-format PNG -dpi 300 -color-count 16 x.png
[ED]u[DB]H: invalid chunk type

So i convert the png to bmp and try that:

autotrace -output-file x.svg -input-format BMP  -dpi 300 -color-count 16 x.bmp 
Error reading BMP file header

But... while testing that i accidentally mis-typed BMP as BPM and i accidentally fed it a PNG file, and it worked:

autotrace -output-file x.svg -input-format BPM -dpi 300 -color-count 16 x.png

No error, despite the BPM typo, and it generates the expected SVG output. That also works if i replace x.png with x.bmp, but only if i feed it an illegal -input-format type.

If i remove -input-format, it behaves just like it does with PNG:

autotrace -output-file x.svg -dpi 300 -color-count 16 x.png
[ED]u[DB]H: invalid chunk type

The only option which works for me is to feed it an invalid -input-format type:

autotrace -output-file x.svg -input-format WTF -dpi 300 -color-count 16 x.png

WTF indeed. Locally supported formats:

autotrace -list-input-formats
Supported input formats:
  PNG Portable network graphics
  TGA Truevision Targa image
  PBM Portable bitmap format
  PNM Portable anymap format
  PGM Portable graymap format
  PPM Portable pixmap format
  BMP Microsoft Windows bitmap image
  3FR Hasselblad CFV/H3D39II

Compilation fails on Ubuntu 2018.04

$ sudo apt install intltool imagemagick libmagickcore-dev pstoedit
$ pstoedit -v
pstoedit: version 3.70 / DLL interface 108 (built: Aug 29 2017 - release build - g++ 7.2.0 - 64-bit) : Copyright (C) 1993 - 2014 Wolfgang Glunz
$ git clone [email protected]:autotrace/autotrace.git
$ cd autotrace
$ ./autogen.sh
$ ./configure
[...]
checking for LIBPSTOEDIT... no
configure: error: Package requirements (pstoedit >= 3.32.0) were not met:

No package 'pstoedit' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBPSTOEDIT_CFLAGS
and LIBPSTOEDIT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Error reading BMP file header

Attached valid bmp (generated with imagemagick) fails.

autotrace\autotrace.exe -input-format BMP lego_5.bmp
Error reading BMP file header
lego_5.zip

AutoTrace version 0.40.0.

warnings for 16, 24 and 32bit TGA files

autotrace only accepts 8bit TGA files. It gives a helpful warning for 16 bit files but a less helpful error message for 24 and 32 bit files. It would be nice to have the same warning for all.

$autotrace hi-mom-16bit.tga 
TGA: channel sizes other than 8 bits are unimplemented

$autotrace hi-mom-24bit.tga 
TGA: too much input data, ignoring extra datum

$autotrace hi-mom-32bit.tga 
TGA: too much input data, ignoring extra datum

Add unit-testing.

We really need some unit-testing here. For example issue #8 has a reproducer, so it's better to use it.

I've no idea what to use. Autotools Autotest or something else?

Autotrace PNG support on Windows

Hi there, I found many tutorials on how to get the libpng working with autotrace on Linux, but how do I achieve that on Windows? Same problem with ImageMagick, it seems like the autotrace is not included in Magick.NET due to GPL license. I need to get the PNG to SVG conversion working on Windows. Thanks in advance!

Autotrace compile on Windows platform

Hi,I want to use libautotrace in my c++ project,but I don't know how to compile it on Windows platform.

Can I compile it in Linux and move the library back to Windows?

The Release is .exe file but I just want library,Thx for responding~~

autoconf warnings

Lots of warnings from running ./autogen.sh about things you should modernize in the build system:

running autoreconf --force --install --verbose
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: running: intltoolize --automake --copy --force
autoreconf: running: /opt/local/bin/aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: /opt/local/bin/glibtoolize --copy --force
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /opt/local/bin/intltoolize --copy --force
You should update your 'aclocal.m4' by running aclocal.
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /opt/local/bin/aclocal --force -I m4
autoreconf: running: /opt/local/bin/autoconf --force
configure.ac:37: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:37: You should run autoupdate.
m4/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:37: the top level
configure.ac:46: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:46: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:1558: AM_CONFIG_HEADER is expanded from...
configure.ac:46: the top level
configure.ac:59: warning: AM_PROG_MKDIR_P: this macro is deprecated, and will soon be removed.
configure.ac:59: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
configure.ac:59: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:1525: AM_PROG_MKDIR_P is expanded from...
m4/po.m4:23: AM_PO_SUBDIRS is expanded from...
m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
configure.ac:59: the top level
configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:59: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/intlmacosx.m4:18: gt_INTL_MACOSX is expanded from...
m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
configure.ac:59: the top level
configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:59: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
configure.ac:59: the top level
configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:59: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/iconv.m4:20: AM_ICONV_LINK is expanded from...
m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
configure.ac:59: the top level
configure.ac:59: warning: The macro `AC_TRY_RUN' is obsolete.
configure.ac:59: You should run autoupdate.
./lib/autoconf/general.m4:2997: AC_TRY_RUN is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/iconv.m4:20: AM_ICONV_LINK is expanded from...
m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
configure.ac:59: the top level
configure.ac:63: warning: The macro `GLIB_GNU_GETTEXT' is obsolete.
configure.ac:63: You should run autoupdate.
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:63: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
aclocal.m4:73: GLIB_LC_MESSAGES is expanded from...
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:63: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/headers.m4:89: _AC_CHECK_HEADER_COMPILE is expanded from...
./lib/autoconf/headers.m4:56: AC_CHECK_HEADER is expanded from...
aclocal.m4:172: GLIB_WITH_NLS is expanded from...
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:63: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/headers.m4:89: _AC_CHECK_HEADER_COMPILE is expanded from...
./lib/autoconf/headers.m4:56: AC_CHECK_HEADER is expanded from...
aclocal.m4:172: GLIB_WITH_NLS is expanded from...
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:63: the top level
configure.ac:63: warning: The macro `AC_OUTPUT_COMMANDS' is obsolete.
configure.ac:63: You should run autoupdate.
./lib/autoconf/status.m4:1025: AC_OUTPUT_COMMANDS is expanded from...
aclocal.m4:172: GLIB_WITH_NLS is expanded from...
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:63: the top level
configure.ac:169: warning: AC_OUTPUT should be used without arguments.
configure.ac:169: You should run autoupdate.
autoreconf: running: /opt/local/bin/autoheader --force
autoreconf: running: /opt/local/bin/automake --add-missing --copy --force-missing
configure.ac:59: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
configure.ac:59: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
configure.ac:59: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
configure.ac:36: installing './compile'
configure.ac:37: installing './config.guess'
configure.ac:37: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
autoreconf: './config.sub' is updated
autoreconf: './config.guess' is updated
autoreconf: Leaving directory '.'

This is with autoconf 2.71 and automake 1.16.3 on macOS 10.13.6.

What can you be helped at?

Hi @lemenkov,

Thanks a lot for the hard work you're having to ressurect this useful
library. It's been dead for the last years and I see it as quite
heroic actually to fight and get this tool back! ๐Ÿ˜ƒ I'm not a regular
C / C++ developer but I've found myself quite in need for this library
for a specific use case (a pet project) and I'm quite stuck without
it. This project has 50 stars by the time being, I suppose it comes
from people which also needs it.

Would you mind to write some documents to help onboarding on this
project? It might be anything to describe the algorithm implemented
here, the current general architecture, the flaws it has or the bugs
it exhibits, as well as where you are willing to head to, and which
use cases you plan to support.

As a reference for people who need autotrace to get a vector
centerline trace out of a raster picture, a gratis, online, but
proprietary tool is available here:

http://online.rapidresizer.com/tracer.php

Again, thanks a lot!

After install of autotrace_0.40.0-20190108_all.deb in Ubuntu 18.04 I got libMagickCore-6.Q16.so.2 Error

Fresh installation of deb-package leads into error message:

matthias@matthias-tuxedo:~/Downloads$ sudo apt install ./autotrace_0.40.0-20190108_all.deb 
Paketlisten werden gelesen... Fertig
Abhรคngigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Hinweis: ยปautotraceยซ wird an Stelle von ยป./autotrace_0.40.0-20190108_all.debยซ gewรคhlt.
Die folgenden NEUEN Pakete werden installiert:
  autotrace
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 16 nicht aktualisiert.
Es mรผssen noch 0 B von 410 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 2.179 kB Plattenplatz zusรคtzlich benutzt.
Holen:1 /home/matthias/Downloads/autotrace_0.40.0-20190108_all.deb autotrace all 0.40.0-20190108 [410 kB]
Vormals nicht ausgewรคhltes Paket autotrace wird gewรคhlt.
(Lese Datenbank ... 284035 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../autotrace_0.40.0-20190108_all.deb ...
Entpacken von autotrace (0.40.0-20190108) ...
Trigger fรผr man-db (2.8.3-2ubuntu0.1) werden verarbeitet ...
autotrace (0.40.0-20190108) wird eingerichtet ...
matthias@matthias-tuxedo:~/Downloads$ autotrace 
autotrace: error while loading shared libraries: libMagickCore-6.Q16.so.2: cannot open shared object file: No such file or directory

Have I missed something?

Invalid svg

For SVG generated by
AutoTrace version 0.40.0. on win10 x64

latest Opera browser says:
This XML file does not appear to have any style information associated with it. The document tree is shown below.

Generated SVG content:
<svg width="1011" height="408" >

should be:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg width="1011" height="408" xmlns="http://www.w3.org/2000/svg">

Empty output on macos

Empty output with zero file size on macos 11.5.2. Bmp to svg. Tried with different settings and files. Nothing working.

g_hash_table_lookup: assertion 'hash_table != NULL' failed

When using autotrace in my project, I get SEGFAULTs when the library is trying to figure out what kind of file I have. I seem to be following what main.c is doing pretty much 1:1, but for whatever reason, on v0.40.0 (well, actually it's from a fork, I get this error. Of course, the command line works fine.

g_hash_table_lookup: assertion 'hash_table != NULL' failed

Here's the full stacktrace:

We're using /mnt/geriatrics/data/that_one_2018_pic_cv.png.                                                                                                                                                                                     
                                                                                                                                                                                                                                               
(xournalpp:6848): GLib-CRITICAL **: 05:41:49.119: g_hash_table_lookup: assertion 'hash_table != NULL' failed                                                                                                                                   
                                                                                                                                                                                                                                               
Thread 1 "xournalpp" received signal SIGSEGV, Segmentation fault.                                                                                                                                                                              
0x00007f4fcb73af70 in at_bitmap_read (reader=0x0, filename=0x5612576d0278 "/mnt/geriatrics/data/that_one_2018_pic_cv.png", opts=0x0, msg_func=0x0, msg_data=0x0)                                                                               
    at src/autotrace.c:132                                                                                                                                                                                                                     
132       *bitmap = (*reader->func) (filename, opts, msg_func, msg_data, reader->data);                                                                                                                                                        
(gdb) backtrace                                                                                                                                                                                                                                
#0  0x00007f4fcb73af70 in at_bitmap_read (reader=0x0, filename=0x5612576d0278 "/mnt/geriatrics/data/that_one_2018_pic_cv.png", opts=0x0, msg_func=0x0, msg_data=0x0)                                                                           
    at src/autotrace.c:132                                                                                                                                                                                                                     
#1  0x00007f4fd14dc36d in transcribe_image (L=0x561256e79f48) at src/lua_util.c:39                                                                                                                                                             
#2  0x00007f4fd62f4585 in  () at /usr/lib/x86_64-linux-gnu/liblua5.3.so.0                                                                                                                                                                      
#3  0x00007f4fd6301355 in  () at /usr/lib/x86_64-linux-gnu/liblua5.3.so.0                                                                                                                                                                      
#4  0x00007f4fd62f4998 in  () at /usr/lib/x86_64-linux-gnu/liblua5.3.so.0                                                                                                                                                                      
#5  0x00007f4fd62f49c1 in  () at /usr/lib/x86_64-linux-gnu/liblua5.3.so.0                                                                                                                                                                      
#6  0x00007f4fd62f3d82 in  () at /usr/lib/x86_64-linux-gnu/liblua5.3.so.0                                                                                                                                                                      
#7  0x00007f4fd62f4c4b in  () at /usr/lib/x86_64-linux-gnu/liblua5.3.so.0                                              
#8  0x00007f4fd62f0594 in lua_pcallk () at /usr/lib/x86_64-linux-gnu/liblua5.3.so.0                                    
#9  0x0000561255df3bea in Plugin::callFunction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x561256f04600, fnc="drawStroke")                                                                 
    at /root/devtop/Code/xournalpp/src/plugin/Plugin.cpp:246                                                           
#10 0x0000561255df2e4d in Plugin::executeMenuEntry(MenuEntry*) (this=0x561256f04600, entry=0x561256e2d150) at /root/devtop/Code/xournalpp/src/plugin/Plugin.cpp:91                                                                             
#11 0x0000561255df2bd3 in operator()(GtkWidget*, MenuEntry*) const (__closure=0x0, bt=0x561257236a70, me=0x561256e2d150) at /root/devtop/Code/xournalpp/src/plugin/Plugin.cpp:84                                                               
#12 0x0000561255df2bfb in _FUN(GtkWidget*, MenuEntry*) () at /root/devtop/Code/xournalpp/src/plugin/Plugin.cpp:84                                                                                                                              
#13 0x00007f4fd66690a2 in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0                                                                                                                                                 
#14 0x00007f4fd667b413 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0                                         
#15 0x00007f4fd66816cf in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0                                                                                                                                             
#16 0x00007f4fd6681c3f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0                                                                                                                                                    
#17 0x00007f4fd6edc354 in gtk_widget_activate () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0                                                                                                                                                    
#18 0x00007f4fd6da2456 in gtk_menu_shell_activate_item () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0                                                                                                                                           
#19 0x00007f4fd6da2733 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0                                               
#20 0x00007f4fd6f2f9f8 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0                                               
#21 0x00007f4fd66692ee in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0                                         
#22 0x00007f4fd6680df9 in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0                                                                                                                                             
#23 0x00007f4fd6681c3f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0                                                                                                                                                    
#24 0x00007f4fd6ed9d04 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0                                               
#25 0x00007f4fd6d8ce00 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0                                               
#26 0x00007f4fd6d8ea63 in gtk_main_do_event () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0                              
#27 0x00007f4fd6a77785 in  () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0                                               
#28 0x00007f4fd6aab2e2 in  () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0                                               
#29 0x00007f4fd7345e6b in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0                                                                                                                                             
#30 0x00007f4fd7346118 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0                                            
#31 0x00007f4fd73461cf in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0                                                                                                                                            
#32 0x00007f4fd678e545 in g_application_run () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0                                                                                                                                                    
#33 0x0000561255ca50e0 in XournalMain::run(int, char**) (argc=1, argv=0x7ffef70ee948) at /root/devtop/Code/xournalpp/src/control/XournalMain.cpp:695                                                                                           
#34 0x0000561255c672da in main(int, char**) (argc=1, argv=0x7ffef70ee948) at /root/devtop/Code/xournalpp/src/Xournalpp.cpp:41

Problem seems to be that the hashtable lookup on the .png extension is broken, though I swear that this is compiled with libpng support.

This also wasn't an issue on Fedora when using autotrace 0.31. My code worked fine.

I've been drilling down into this lookup functionality to see if I can pinpoint the issue, but the workaround I'm considering employing for now is to just... pass .png as an argument. Though, I'd like to be able to support a variety of image formats with my project.

(Here's my code: https://github.com/WillNilges/inkpath/blob/ceb6647a8260420f9e6e4fb0fe4a3b16bdc5abd8/src/lua_util.c)

make fails - png.h not found

M2 Mac, OS 13.5.2


src/input-gf.c:319:44: warning: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Wconstant-conversion]
          PIXEL(sym, matrix_y, matrix_x) = 255;
                                         ~ ^~~
1 warning generated.
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/opt/homebrew/Cellar/graphicsmagick/1.3.41_1/include/GraphicsMagick -I/opt/homebrew/Cellar/pstoedit/3.78/include -I/opt/homebrew/Cellar/glib/2.78.0/include -I/opt/homebrew/Cellar/glib/2.78.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.78.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.42/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c src/input-gf.c -o src/input-gf.o >/dev/null 2>&1
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I/opt/homebrew/Cellar/graphicsmagick/1.3.41_1/include/GraphicsMagick -I/opt/homebrew/Cellar/pstoedit/3.78/include  -I/opt/homebrew/Cellar/glib/2.78.0/include -I/opt/homebrew/Cellar/glib/2.78.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.78.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.42/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -DLOCALEDIR=\""/usr/local/share/locale"\"   -g -O2 -c -o src/input-png.lo src/input-png.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/opt/homebrew/Cellar/graphicsmagick/1.3.41_1/include/GraphicsMagick -I/opt/homebrew/Cellar/pstoedit/3.78/include -I/opt/homebrew/Cellar/glib/2.78.0/include -I/opt/homebrew/Cellar/glib/2.78.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.78.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.42/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c src/input-png.c  -fno-common -DPIC -o src/.libs/input-png.o
src/input-png.c:32:10: fatal error: 'png.h' file not found
#include <png.h>
         ^~~~~~~
1 error generated.
make[2]: *** [src/input-png.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

libpng is installed

==> libpng: stable 1.6.40 (bottled), HEAD
Library for manipulating PNG images
http://www.libpng.org/pub/png/libpng.html
/opt/homebrew/Cellar/libpng/1.6.40 (27 files, 1.3MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-06-26 at 14:02:13
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lib/libpng.rb
License: libpng-2.0

Centerline Tracing - Multiple paths instead of a single path

Hello
I have been using autotrace 0.30, and when generating a svg from raster image, using centerline, I obtained a SVG with multiple paths, instead of one single path.

Example in 0.30:
<svg width="400" height="400"> <path style="stroke:#424242; fill:none;" d="M211 62C207.075 62 197.668 63.8293 194.603 61.2269C190.957 58.1298 191.708 43.6488 197.059 42.6034C201.181 41.7979 210.331 42.323 211.682 47.1088C212.828 51.1682 209.712 59.9485 215.148 61.5517C231.024 66.2335 254.571 55.5178 269.852 65.0131C276.105 68.8988 271.467 91.3109 270.83 98C268.262 124.987 266.044 152.887 266 180C265.989 186.684 268.228 206.565 263.397 211.397C258.601 216.193 243.209 212 237 212C210.305 211.998 183.661 210 157 210C149.523 210 123.189 205.282 126 218C138.306 214.465 157.138 218.03 170 218.91C189.843 220.269 210.249 217.955 230 220.285C240.323 221.504 250.656 220.381 261 221.09C264.377 221.321 270.44 223.457 273.377 220.972C278.194 216.897 268.561 213.559 266 213"/> <path style="stroke:#424242; fill:none;" d="M138 208C137.978 174.764 135.751 138.952 131.424 106C130.211 96.7626 130.712 87.2749 129.83 78C129.526 74.7969 127.963 70.2511 130.603 67.6034C133.754 64.4442 143.762 65.0212 148 65.0008C162.691 64.9299 177.299 63 192 63"/> <path style="stroke:#424242; fill:none;" d="M175 80L170 89C168.828 85.0336 168.093 79.2213 169.318 75.1528C170.962 69.6944 174.559 75.2321 175 78C177.999 78 183.859 76.9269 185.972 79.6034C188.079 82.2723 186.469 86.9959 186.169 90C185.379 97.9035 186.776 112.184 181.991 118.772C177.582 124.841 160.85 124.097 154.005 123.966C143.725 123.77 145.658 100.767 145.089 93C144.895 90.3517 143.575 84.8987 145.117 82.5995C148.537 77.5018 168.353 79 174 79"/> <path style="stroke:#424242; fill:none;" d="M197 81C216.484 82.5377 236.688 82.5852 256 79"/> <path style="stroke:#424242; fill:none;" d="M198 97L226 94"/> <path style="stroke:#424242; fill:none;" d="M236 102C241.798 98.6159 247.435 94.8666 254 98L251.972 109.667L241.598 111.451L224 134L215.039 127.631L206.884 136L189 163L180 149L179 149L172 163L159 136L158 136C152.652 146.149 147.327 159.208 158 167L165 152"/> <path style="stroke:#424242; fill:none;" d="M250 98L244 109"/> <path style="stroke:#424242; fill:none;" d="M235 106L242 110"/> <path style="stroke:#424242; fill:none;" d="M196 111L218 109"/> <path style="stroke:#424242; fill:none;" d="M180 149C180.787 140.044 186.172 123.959 193 118L205 139"/> <path style="stroke:#424242; fill:none;" d="M257 130C261.377 150.47 235.011 128.689 252.955 127.887C254.608 127.813 255.502 128.394 257 129C252.658 133.345 243.091 148.352 236.001 146.427C231.147 145.109 227.328 138.478 224 135C215.627 144.091 212.751 152.233 204 140"/> <path style="stroke:#424242; fill:none;" d="M258 127L257 128"/> <path style="stroke:#424242; fill:none;" d="M165 147L173 134L180 146"/> <path style="stroke:#424242; fill:none;" d="M143 149L149 157"/> <path style="stroke:#424242; fill:none;" d="M216.004 154.797C226.147 153.596 225.982 169.899 216.985 171.119C207.378 172.422 206.617 155.909 216.004 154.797"/> <path style="stroke:#424242; fill:none;" d="M244.005 155.743C255.186 151.45 258.551 167.8 248.956 171.392C238.788 175.199 233.982 159.592 244.005 155.743"/> <path style="stroke:#424242; fill:none;" d="M150 162L149 166"/> <path style="stroke:#424242; fill:none;" d="M191 180L251 183"/> <path style="stroke:#424242; fill:none;" d="M150 182L173 182"/> <path style="stroke:#424242; fill:none;" d="M150 198L250 200"/> <path style="stroke:#424242; fill:none;" d="M125 219C127.943 229.24 144.197 228.294 153 228.711C181.824 230.075 213.269 233.177 242 230.326C250.74 229.459 273.114 234.929 275 223"/> <path style="stroke:#424242; fill:none;" d="M153 231C142.408 259.077 135.71 288.724 125.565 317C122.656 325.107 116.068 340.996 128.004 345.242C139.393 349.294 142.994 328.018 145.333 321C154.89 292.329 166.955 261.013 171 231"/> <path style="stroke:#424242; fill:none;" d="M192 231C192.393 250.018 195.938 269.006 197.001 288C197.27 292.801 201.503 300.643 207.682 296.932C212.119 294.267 210.998 283.394 211 279C211.007 263.452 213.152 247.288 216 232"/> <path style="stroke:#424242; fill:none;" d="M239 232C243.18 264.367 255.44 296.768 264.576 328C266.448 334.402 275.803 359.376 285.141 344.941C290.191 337.135 281.27 321.81 278.667 314C273.011 297.032 267.656 279.972 262 263C258.737 253.21 253.898 242.286 253 232"/> </svg>

Example in 0.40:
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"> <path style="stroke:#424242; fill:none;" d="M211 62C207.075 62 197.668 63.8293 194.603 61.2269C190.957 58.1298 191.708 43.6488 197.059 42.6034C201.181 41.7979 210.331 42.323 211.682 47.1088C212.828 51.1682 209.712 59.9485 215.148 61.5517C231.024 66.2335 254.571 55.5178 269.852 65.0131C276.105 68.8988 271.467 91.3109 270.83 98C268.262 124.987 266.044 152.887 266 180C265.989 186.684 268.228 206.565 263.397 211.397C258.601 216.193 243.209 212 237 212C210.305 211.998 183.661 210 157 210C149.523 210 123.189 205.282 126 218C138.306 214.465 157.138 218.03 170 218.91C189.843 220.269 210.249 217.955 230 220.285C240.323 221.504 250.656 220.381 261 221.09C264.377 221.321 270.44 223.457 273.377 220.972C278.194 216.897 268.561 213.559 266 213M138 208C137.978 174.764 135.751 138.952 131.424 106C130.211 96.7626 130.712 87.2749 129.83 78C129.526 74.7969 127.963 70.2511 130.603 67.6034C133.754 64.4442 143.762 65.0212 148 65.0008C162.691 64.9299 177.299 63 192 63M175 80L170 89C168.828 85.0336 168.093 79.2213 169.318 75.1528C170.962 69.6944 174.559 75.2321 175 78C177.999 78 183.859 76.9269 185.972 79.6034C188.079 82.2723 186.469 86.9959 186.169 90C185.379 97.9035 186.776 112.184 181.991 118.772C177.582 124.841 160.85 124.097 154.005 123.966C143.725 123.77 145.658 100.767 145.089 93C144.895 90.3517 143.575 84.8987 145.117 82.5995C148.537 77.5018 168.353 79 174 79M197 81C216.484 82.5377 236.688 82.5852 256 79M198 97L226 94M236 102C241.798 98.6159 247.435 94.8666 254 98L251.972 109.667L241.598 111.451L224 134L215.039 127.631L206.884 136L189 163L180 149L179 149L172 163L159 136L158 136C152.652 146.149 147.327 159.208 158 167L165 152M250 98L244 109M235 106L242 110M196 111L218 109M180 149C180.787 140.044 186.172 123.959 193 118L205 139M257 130C261.377 150.47 235.011 128.689 252.955 127.887C254.608 127.813 255.502 128.394 257 129C252.658 133.345 243.091 148.352 236.001 146.427C231.147 145.109 227.328 138.478 224 135C215.627 144.091 212.751 152.233 204 140M258 127L257 128M165 147L173 134L180 146M143 149L149 157M216.004 154.797C226.147 153.596 225.982 169.899 216.985 171.119C207.378 172.422 206.617 155.909 216.004 154.797M244.005 155.743C255.186 151.45 258.551 167.8 248.956 171.392C238.788 175.199 233.982 159.592 244.005 155.743M150 162L149 166M191 180L251 183M150 182L173 182M150 198L250 200M125 219C127.943 229.24 144.197 228.294 153 228.711C181.824 230.075 213.269 233.177 242 230.326C250.74 229.459 273.114 234.929 275 223M153 231C142.408 259.077 135.71 288.724 125.565 317C122.656 325.107 116.068 340.996 128.004 345.242C139.393 349.294 142.994 328.018 145.333 321C154.89 292.329 166.955 261.013 171 231M192 231C192.393 250.018 195.938 269.006 197.001 288C197.27 292.801 201.503 300.643 207.682 296.932C212.119 294.267 210.998 283.394 211 279C211.007 263.452 213.152 247.288 216 232M239 232C243.18 264.367 255.44 296.768 264.576 328C266.448 334.402 275.803 359.376 285.141 344.941C290.191 337.135 281.27 321.81 278.667 314C273.011 297.032 267.656 279.972 262 263C258.737 253.21 253.898 242.286 253 232"/> </svg>

How can I make it so in the new autotrace, to generate the svg using multiple paths and not just one?

Thanks!

make check doesn't work as per INSTALL mentions

The INSTALL file mentions that tests can be run with the check target (c.f. https://github.com/autotrace/autotrace/blob/master/INSTALL#L53), but such target is not defined in Makefile.am (TESTS should be listed, I believe).

Currently, `make check' fails like:

starting phase `check'
Making check in po
make[1]: Entering directory '/tmp/guix-build-autotrace-0.40.0-20190624.59.drv-0/source/po'
make[1]: *** No rule to make target '../atou.c', needed by 'autotrace.pot'.  Stop.
make[1]: Leaving directory '/tmp/guix-build-autotrace-0.40.0-20190624.59.drv-0/source/po'
make: *** [Makefile:966: check-recursive] Error 1

Test suite failed, dumping logs.
command "make" "check" "-j" "2" failed with status 2

The workaround I found was to run instead the tests/runtests.sh script.

Use ImageMagick to support PNG filetype

I am trying to use Autotrace to process PNG files. When I run ./configure, I see the following warning message:

checking for Magick-config... no
configure: WARNING: *** Magick-config is not found.                      ***
configure: WARNING: *** ImageMagick input handler is disabled.           ***

Is there a parameter I can provide when running ./configure to use ImageMagick? I have ImageMagick installed on my machine already.

Can't achieve a perfect square

No matter what parameter I try, I can't achieve a perfect square, looks like some filtering cannot be turned off.

autotrace\autotrace.exe -centerline -remove-adjacent-corners --line-threshold 10 -line-reversion-threshold 0.01 -corner-surround 12 -corner-always-threshol 60 -corner-threshold 120 -error-threshold 3 -filter-iterations 0 -despeckle-level 20 -despeckle-tightness 2.0 -noise-removal 0.99 -output-file output.svg -output-format svg basic.bmp

2021-11-02 14_11_09-output svg - Inkscape

Proprietary company / project using Autotrace name for a very similar project.

IDK if this project has filed a trademark, but a proprietary project / company using the same name as FOSS for the same thing bothers me.
https://www.youtube.com/watch?v=3Zu9daXcIJc
https://www.youtube.com/watch?v=7nwGafNRGIA
https://www.vectornator.io/
I'm also curious if this project is... Just using autotrace / potrace, which would presumably violate the GPL. They claim they are using "machine learning" to trace from bitmap, which seems unlikely to me given that such an application of ML is unnecessary to achieve this kind of thing and would be comparatively computationally expensive. In the attached video, they have traced from bitmap to vector with little delay, which is also unlikely if they are using a cloud based ML pipeline (don't think you can run such things on an ipad, as they do in the video)

Am worried I'll get my shit hacked in retaliation for posting this (devs sound / look Eastern Bloc) but it bothers me enough to raise attention for it and I can't delete this now lol

Release dependencies

Trying current release on debian:

autotrace: error while loading shared libraries: libMagickCore-6.Q16.so.2: cannot open shared object file: No such file or directory

even though I have magick installed.

ldd ./autotrace
        linux-vdso.so.1 (0x00007ffe913db000)
        libautotrace.so.3 => /lib/libautotrace.so.3 (0x0000741510400000)
        libMagickCore-6.Q16.so.6 => /lib/x86_64-linux-gnu/libMagickCore-6.Q16.so.6 (0x0000741510000000)

please specify dependencies

sudo dpkg -i autotrace_0.40.0-20200219_all.deb
Selecting previously unselected package autotrace.
(Reading database ... 74587 files and directories currently installed.)
Preparing to unpack autotrace_0.40.0-20200219_all.deb ...
Unpacking autotrace (0.40.0-20200219) ...
dpkg: dependency problems prevent configuration of autotrace:
 autotrace depends on libpstoedit0c2a; however:
  Package libpstoedit0c2a is not installed.
 autotrace depends on libtiff5; however:
  Package libtiff5 is not installed.

dpkg: error processing package autotrace (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.11.2-2) ...
Errors were encountered while processing:
 autotrace

Incorrect background removal

blender_logo_socket
I'm doing tests on the Blender logo with a transparent background.
Running autotrace without --background-color=FFFFFF results in an svg with white background.
Running it with background removal results in color being added to the inner parts of the logo including the letters.
This is the command that I ran:
autotrace --output-format=svg --background-color=FFFFFF blender_logo_socket.png > blender_logo_socket_autotrace.svg

This is the result after converting it back to png:
blender_logo_socket_autotrace

I've also tried multiple combinations of filter-iterations & noise-removal to no avail.
Am I missing something or is it just that the background removal script is implemented poorly?

heap buffer overflow in pstoedit_suffix_table_init (output-pstoedit.c)

The attached testcase causes an overflow. Reproduce with autotrace $FILE

==31756==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61700000ff20 at pc 0x7f11a5538380 bp 0x7ffecc970f90 sp 0x7ffecc970f88                                                      
WRITE of size 8 at 0x61700000ff20 thread T0                                                                                                                                                    
    #0 0x7f11a553837f in pstoedit_suffix_table_init /var/tmp/portage/media-gfx/autotrace-0.31.1-r7/work/autotrace-0.31.1/output-pstoedit.c:103:54                                              
    #1 0x7f11a5536544 in pstoedit_suffix_table_lookup_shallow /var/tmp/portage/media-gfx/autotrace-0.31.1-r7/work/autotrace-0.31.1/output-pstoedit.c:143:5                                     
    #2 0x7f11a5536544 in output_pstoedit_is_writer /var/tmp/portage/media-gfx/autotrace-0.31.1-r7/work/autotrace-0.31.1/output-pstoedit.c:160                                                  
    #3 0x7f11a556020b in at_splines_write /var/tmp/portage/media-gfx/autotrace-0.31.1-r7/work/autotrace-0.31.1/autotrace.c:375:7                                                               
    #4 0x4f579b in main /var/tmp/portage/media-gfx/autotrace-0.31.1-r7/work/autotrace-0.31.1/main.c:161:3                                                                                      
    #5 0x7f11a460761f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.22-r4/work/glibc-2.22/csu/libc-start.c:289                                                                        
    #6 0x4196b8 in _init (/usr/bin/autotrace+0x4196b8)                                                                                                                                         

0x61700000ff21 is located 0 bytes to the right of 673-byte region [0x61700000fc80,0x61700000ff21)                                                                                              
allocated by thread T0 here:                                                                                                                                                                   
    #0 0x4c0c08 in malloc /var/tmp/portage/sys-devel/llvm-3.8.1/work/llvm-3.8.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:52                                                      
    #1 0x7f11a5538053 in pstoedit_suffix_table_init /var/tmp/portage/media-gfx/autotrace-0.31.1-r7/work/autotrace-0.31.1/output-pstoedit.c:87:7                                                

SUMMARY: AddressSanitizer: heap-buffer-overflow /var/tmp/portage/media-gfx/autotrace-0.31.1-r7/work/autotrace-0.31.1/output-pstoedit.c:103:54 in pstoedit_suffix_table_init                    
Shadow bytes around the buggy address:                                                                                                                                                         
  0x0c2e7fff9f90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              
  0x0c2e7fff9fa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              
  0x0c2e7fff9fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              
  0x0c2e7fff9fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              
  0x0c2e7fff9fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              
=>0x0c2e7fff9fe0: 00 00 00 00[01]fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              
  0x0c2e7fff9ff0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              
  0x0c2e7fffa000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              
  0x0c2e7fffa010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              
  0x0c2e7fffa020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              
  0x0c2e7fffa030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==31756==ABORTING

sample.bmp.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.