Potrace |
|
Potrace(TM) is a utility for tracing a bitmap, which means,
transforming a bitmap into a smooth, scalable image. The input is a
bitmap (PBM, PGM, PPM, or BMP format), and the default output is an
encapsulated PostScript file (EPS). A typical use is to create EPS
files from scanned data, such as company or university logos,
handwritten notes, etc. The resulting image is not "jaggy" like a
bitmap, but smooth. It can then be rendered at any resolution.
Potrace can currently produce the following output formats: EPS, PostScript, PDF, SVG (scalable vector graphics), DXF, PGM (for easy antialiasing of pixel-based images), Gimppath, and XFig. Additional backends might be added in the future. Mkbitmap is a program distributed with Potrace which can be used to pre-process the input for better tracing behavior on greyscale and color images. See the mkbitmap examples page. |
![]() |
![]() |
| More examples... |
| Trouble using Potrace? Here are the answers to some frequently asked questions. |
|
For changes prior to version 1.9, see the file NEWS.
For a more detailed list of changes, see the ChangeLog.
August 19, 2011: Release 1.10. A DXF backend was added. The output is in the drawing interchange format used by computer aided design software. Thanks to Jonas Benedett Dorr for testing. The Gimppath backend was changed to be compatible with current versions of Gimp. The EPS, PDF, and SVG backends now use high-resolution bounding boxes. The default scaling of the EPS, PDF, and SVG backends is now fixed at 72dpi. A new option --flat was added to the SVG backend. A new option --tight was added to remove whitespace around the input image before calculating its scaling and placement. December 21, 2010: Release 1.9. The xfig and eps backends were improved, and a fixed pagesize PDF backend was added. Support for BMP version 4 and version 5 files, as well as top-down BMP files, was added. Minor speed improvements to Potrace and major speed improvements to mkbitmap. A Gaussian blur option was added to mkbitmap. Libtool is now used to build and optionally install the Potrace library. An optional simplified progress bar was added for dumb terminals. This release also contains some portability improvements, cross-compilation improvements, and minor bug fixes.
|
|
Potrace is built from sources using the standard configure/make
commands. Please see the file INSTALL for generic
installation instructions, and the file README for
compile time configuration options specific to Potrace. Some
pre-compiled binary distributions are also available. See the file README for instructions on how to install Potrace from
a binary distribution. Additional instructions for Windows users are
contained in the file README-WIN. If you would
like to ensure the accuracy of the downloaded files, you can
double-check their SHA1 sums.
AROS archives for sources and updates. (2) Debian i386 Package maintained by Bartosz Fenski <fenio at debian.org>. Debian has a centralized package management and users may run "apt-get install potrace" as root to install. If installing from the package directly, you need both potrace and libpotrace0 (3) Redhat x86_64 Packages provided by Manuel Joriatti <manu-schwalbe at wanadoo.fr>. (4) SuSE RPMs provided by Stanislav Brabec <sbrabec at suse.cz>. Potrace appears in the official SuSE distribution. Updates sometimes appear in the SuSE supplementary program. (5) Solaris-i386 and x86_64 binaries and packages provided by Apostolos Syropoulos <asyropoulos at gmail.com>. (6) Amiga Package provided by Alfred Faust <alfred.j.faust at gmx.de>. See the OS4 Depot for updates. (7) ArchLinux package maintained by Damir Perisa <damir at archlinux.org>. ArchLinux has a centralized package management and users need to run "pacman -S potrace" as root to install. (8) FreeBSD Packages maintained by Piotr Smyrak <smyru at heron.pl>. (9) Fink package maintained by Daniel Macks <dmacks at netspace.org>. Fink has a centralized package management and users need to run "fink install potrace" as root to install. (10) Macports has a centralized package management and users need to run "port install potrace" as root to install. |
potrace 1.10. Transforms bitmaps into vector graphics. Usage: potrace [options] [filename...] General options: -h, --help - print this help message and exit -v, --version - print version info and exit -l, --license - print license info and exit File selection: filename - an input file -o, --output filename - write all output to this file -- - end of options; 0 or more input filenames follow Backend selection: -b, --backend name - select backend by name -e, --eps - EPS backend (encapsulated PostScript) (default) -p, --postscript - PostScript backend -s, --svg - SVG backend (scalable vector graphics) -g, --pgm - PGM backend (portable greymap) -b pdf - PDF backend (portable document format) -b pdfpage - fixed page-size PDF backend -b dxf - DXF backend (drawing interchange format) -b gimppath - Gimppath backend (GNU Gimp) -b xfig - XFig backend Algorithm options: -z, --turnpolicy policy - how to resolve ambiguities in path decomposition -t, --turdsize n - suppress speckles of up to this size (default 2) -a, --alphamax n - corner threshold parameter (default 1) -n, --longcurve - turn off curve optimization -O, --opttolerance n - curve optimization tolerance (default 0.2) -u, --unit n - quantize output to 1/unit pixels (default 10) -d, --debug n - produce debugging output of type n (n=1,2,3) Scaling and placement options: -P, --pagesize format - page size (default is letter) -W, --width dim - width of output image -H, --height dim - height of output image -r, --resolution n[xn] - resolution (in dpi) -x, --scale n[xn] - scaling factor (pixel-based backends) -S, --stretch n - yresolution/xresolution -A, --rotate angle - rotate counterclockwise by angle -M, --margin dim - margin -L, --leftmargin dim - left margin -R, --rightmargin dim - right margin -T, --topmargin dim - top margin -B, --bottommargin dim - bottom margin --tight - remove whitespace around the input image Color options, supported by some backends: -C, --color #rrggbb - set line color (default black) --fillcolor #rrggbb - set fill color (default transparent) --opaque - make white shapes opaque SVG options: --group - group related paths together --flat - whole image as a single path Postscript/EPS/PDF options: -c, --cleartext - do not compress the output -2, --level2 - use postscript level 2 compression (default) -3, --level3 - use postscript level 3 compression -q, --longcoding - do not optimize for file size PGM options: -G, --gamma n - gamma value for anti-aliasing (default 2.2) Frontend options: -k, --blacklevel n - black/white cutoff in input file (default 0.5) -i, --invert - invert bitmap Progress bar options: --progress - show progress bar --tty mode - progress bar rendering: vt100 or dumb Dimensions can have optional units, e.g. 6.5in, 15cm, 100pt. Default is inches (or pixels for pgm, dxf, and gimppath backends). Possible input file formats are: pnm (pbm, pgm, ppm), bmp. Backends are: eps, postscript, ps, pdf, pdfpage, svg, dxf, pgm, gimppath, xfig. For detailed usage information, see the potrace(1) man page. |
|
|
|
A non-GPL version of Potrace, called Potrace Professional(TM), is
available for integration into proprietary software. Licenses are
available from my company, |
Commercial software:
|
Here are some web articles, listings, and web logs that cover Potrace
and its applications. I particularly recommend the article by C. Scott
Ananian on how to make stained glass windows from color scans using
open source software. It is an amazing, step-by-step description of
the process used, with beautiful screen shots. Similar techniques
might also be applicable for vectorizing color cartoons.
|
The following are paid advertisements.
|
| 1.10 |
| Copyright © 2001-2011 Peter Selinger. |
| The Potrace logo and mascot was designed by Karol Krenski. Copyright © 2003 Karol Krenski and Peter Selinger. The logo is licensed under GPL. |
|
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
| "Potrace" is a trademark of Peter Selinger. "Potrace Professional" and "Icosasoft" are trademarks of Icosasoft Software Inc. Other trademarks belong to their respective owners. |