xref: /potrace-1.14/README (revision b3fce824)
1189777a2SCristian Pallares
2189777a2SCristian Pallares	   POTRACE - transform bitmaps into vector graphics
3189777a2SCristian Pallares
4189777a2SCristian Pallares				* * *
5189777a2SCristian Pallares
6189777a2SCristian PallaresDESCRIPTION
7189777a2SCristian Pallares
8189777a2SCristian Pallares Potrace is a tool for tracing a bitmap, which means, transforming a
9189777a2SCristian Pallares bitmap into a smooth, scalable image.  The input is a bitmap (PBM,
10189777a2SCristian Pallares PGM, PPM, or BMP), and the default output is one of several vector
11189777a2SCristian Pallares file formats.  A typical use is to create EPS files from scanned
12189777a2SCristian Pallares data, such as company or university logos, handwritten notes, etc.
13189777a2SCristian Pallares The resulting image is not "jaggy" like a bitmap, but smooth. It can
14189777a2SCristian Pallares then be rendered at any resolution.
15189777a2SCristian Pallares
16189777a2SCristian Pallares Potrace can currently produce the following output formats: EPS,
17189777a2SCristian Pallares PostScript, PDF, SVG (scalable vector graphics), DXF, GeoJSON, PGM
18189777a2SCristian Pallares (for easy antialiasing of pixel-based images), Gimppath, and
19189777a2SCristian Pallares XFig. Additional backends might be added in the future.
20189777a2SCristian Pallares
21189777a2SCristian Pallares A separate program, mkbitmap, is also provided. This program can act
22189777a2SCristian Pallares as a pre-processor for Potrace, applying scaling and various filters
23189777a2SCristian Pallares to an image before converting it to a bitmap. This is useful for
24189777a2SCristian Pallares potracing greyscale and color images.
25189777a2SCristian Pallares
26189777a2SCristian PallaresDEPENDENCIES
27189777a2SCristian Pallares
28189777a2SCristian Pallares Potrace relies on the zlib library for PostScript level 3
29189777a2SCristian Pallares compression. This library is pre-installed on most modern systems.
30189777a2SCristian Pallares If not present, it can be obtained from http://www.gzip.org/zlib/.
31189777a2SCristian Pallares
32189777a2SCristian PallaresCOMPILATION
33189777a2SCristian Pallares
34189777a2SCristian Pallares For generic compilation instructions, see the file INSTALL.  In
35189777a2SCristian Pallares addition, the following compile time options (options to ./configure)
36189777a2SCristian Pallares are supported.
37189777a2SCristian Pallares
38189777a2SCristian Pallares  --with-libpotrace       install Potrace library and headers (default: no)
39189777a2SCristian Pallares  --disable-zlib          disable PostScript level 3 compression
40189777a2SCristian Pallares  --enable-metric         use metric units (centimeters) as default
41189777a2SCristian Pallares  --enable-a4             use a4 as the default papersize
42189777a2SCristian Pallares  --enable-dumb-tty       use simplified ASCII-only progress bar
43189777a2SCristian Pallares
44189777a2SCristian Pallares See also ./configure --help.
45189777a2SCristian Pallares
46189777a2SCristian PallaresINSTALLING
47189777a2SCristian Pallares
48189777a2SCristian Pallares If you are installing from sources, just do "make install" as root.
49189777a2SCristian Pallares If you are installing from a binary distribution, just copy the
50189777a2SCristian Pallares "potrace" and "mkbitmap" binaries to a place where the operating
51189777a2SCristian Pallares system expects them, such as /usr/local/bin. Also copy the files
52189777a2SCristian Pallares "potrace.1" and "mkbitmap.1" to a directory where the operating
53189777a2SCristian Pallares system looks for man pages, such as /usr/local/man/man1. For
54189777a2SCristian Pallares instructions on installing Potrace under Windows, see the file
55189777a2SCristian Pallares README-WIN
56189777a2SCristian Pallares
57189777a2SCristian PallaresUSAGE
58189777a2SCristian Pallares
59189777a2SCristian Pallares For more detailed usage information, see the man page.
60189777a2SCristian Pallares
61189777a2SCristian Pallares Usage: potrace [options] [filename...]
62189777a2SCristian Pallares General options:
63189777a2SCristian Pallares  -h, --help                 - print this help message and exit
64189777a2SCristian Pallares  -v, --version              - print version info and exit
65189777a2SCristian Pallares  -l, --license              - print license info and exit
66189777a2SCristian Pallares File selection:
67189777a2SCristian Pallares  <filename>                 - an input file
68189777a2SCristian Pallares  -o, --output <filename>    - write all output to this file
69189777a2SCristian Pallares  --                         - end of options; 0 or more input filenames follow
70189777a2SCristian Pallares Backend selection:
71189777a2SCristian Pallares  -b, --backend <name>       - select backend by name
72189777a2SCristian Pallares  -e, --eps                  - EPS backend (encapsulated PostScript) (default)
73189777a2SCristian Pallares  -p, --postscript           - PostScript backend
74189777a2SCristian Pallares  -s, --svg                  - SVG backend (scalable vector graphics)
75189777a2SCristian Pallares  -g, --pgm                  - PGM backend (portable greymap)
76189777a2SCristian Pallares  -b pdf                     - PDF backend (portable document format)
77189777a2SCristian Pallares  -b pdfpage                 - fixed page-size PDF backend
78189777a2SCristian Pallares  -b dxf                     - DXF backend (drawing interchange format)
79189777a2SCristian Pallares  -b geojson                 - GeoJSON backend
80189777a2SCristian Pallares  -b gimppath                - Gimppath backend (GNU Gimp)
81189777a2SCristian Pallares  -b xfig                    - XFig backend
82189777a2SCristian Pallares Algorithm options:
83189777a2SCristian Pallares  -z, --turnpolicy <policy>  - how to resolve ambiguities in path decomposition
84189777a2SCristian Pallares  -t, --turdsize <n>         - suppress speckles of up to this size (default 2)
85189777a2SCristian Pallares  -a, --alphamax <n>         - corner threshold parameter (default 1)
86189777a2SCristian Pallares  -n, --longcurve            - turn off curve optimization
87189777a2SCristian Pallares  -O, --opttolerance <n>     - curve optimization tolerance (default 0.2)
88189777a2SCristian Pallares  -u, --unit <n>             - quantize output to 1/unit pixels (default 10)
89189777a2SCristian Pallares  -d, --debug <n>            - produce debugging output of type n (n=1,2,3)
90189777a2SCristian Pallares Scaling and placement options:
91189777a2SCristian Pallares  -P, --pagesize <format>    - page size (default is letter)
92189777a2SCristian Pallares  -W, --width <dim>          - width of output image
93189777a2SCristian Pallares  -H, --height <dim>         - height of output image
94189777a2SCristian Pallares  -r, --resolution <n>[x<n>] - resolution (in dpi) (dimension-based backends)
95189777a2SCristian Pallares  -x, --scale <n>[x<n>]      - scaling factor (pixel-based backends)
96189777a2SCristian Pallares  -S, --stretch <n>          - yresolution/xresolution
97189777a2SCristian Pallares  -A, --rotate <angle>       - rotate counterclockwise by angle
98189777a2SCristian Pallares  -M, --margin <dim>         - margin
99189777a2SCristian Pallares  -L, --leftmargin <dim>     - left margin
100189777a2SCristian Pallares  -R, --rightmargin <dim>    - right margin
101189777a2SCristian Pallares  -T, --topmargin <dim>      - top margin
102189777a2SCristian Pallares  -B, --bottommargin <dim>   - bottom margin
103189777a2SCristian Pallares  --tight                    - remove whitespace around the input image
104189777a2SCristian Pallares Color options, supported by some backends:
105189777a2SCristian Pallares  -C, --color #rrggbb        - set foreground color (default black)
106189777a2SCristian Pallares  --fillcolor #rrggbb        - set fill color (default transparent)
107189777a2SCristian Pallares  --opaque                   - make white shapes opaque
108189777a2SCristian Pallares SVG options:
109189777a2SCristian Pallares  --group                    - group related paths together
110189777a2SCristian Pallares  --flat                     - whole image as a single path
111189777a2SCristian Pallares Postscript/EPS/PDF options:
112189777a2SCristian Pallares  -c, --cleartext            - do not compress the output
113189777a2SCristian Pallares  -2, --level2               - use postscript level 2 compression (default)
114189777a2SCristian Pallares  -3, --level3               - use postscript level 3 compression
115189777a2SCristian Pallares  -q, --longcoding           - do not optimize for file size
116189777a2SCristian Pallares PGM options:
117189777a2SCristian Pallares  -G, --gamma <n>            - gamma value for anti-aliasing (default 2.2)
118189777a2SCristian Pallares Frontend options:
119189777a2SCristian Pallares  -k, --blacklevel <n>       - black/white cutoff in input file (default 0.5)
120189777a2SCristian Pallares  -i, --invert               - invert bitmap
121189777a2SCristian Pallares Progress bar options:
122189777a2SCristian Pallares  --progress                 - show progress bar
123189777a2SCristian Pallares  --tty <mode>               - progress bar rendering: vt100 or dumb
124189777a2SCristian Pallares
125189777a2SCristian Pallares Dimensions can have optional units, e.g. 6.5in, 15cm, 100pt.
126189777a2SCristian Pallares Default is inches (or pixels for pgm, dxf, and gimppath backends).
127189777a2SCristian Pallares Possible input file formats are: pnm (pbm, pgm, ppm), bmp.
128189777a2SCristian Pallares Backends are: eps, postscript, ps, pdf, pdfpage, svg, dxf, geojson, pgm,
129189777a2SCristian Pallares gimppath, xfig.
130189777a2SCristian Pallares
131189777a2SCristian PallaresPOTRACE LIBRARY (FOR DEVELOPERS)
132189777a2SCristian Pallares
133189777a2SCristian Pallares As of Potrace release 1.6, the Potrace core functionality has been
134189777a2SCristian Pallares separated into a library libpotrace.a. This makes it easy to integrate
135189777a2SCristian Pallares tracing functionality into other GPL programs. The API of the library
136189777a2SCristian Pallares is defined in the header file potracelib.h, and is documented in
137189777a2SCristian Pallares doc/potracelib.pdf. It is not by default installed, but can be
138189777a2SCristian Pallares installed with the --with-libpotrace configuration option.
139189777a2SCristian Pallares
140189777a2SCristian PallaresDOCUMENTATION
141189777a2SCristian Pallares
142189777a2SCristian Pallares Usage information is contained in the man page:
143189777a2SCristian Pallares http://potrace.sourceforge.net/potrace.html
144189777a2SCristian Pallares
145189777a2SCristian Pallares Many common questions are answered in the FAQ:
146189777a2SCristian Pallares http://potrace.sourceforge.net/faq.html
147189777a2SCristian Pallares
148189777a2SCristian Pallares Some examples are given on the following web pages:
149189777a2SCristian Pallares http://potrace.sourceforge.net/samples.html
150189777a2SCristian Pallares http://potrace.sourceforge.net/mkbitmap.html
151189777a2SCristian Pallares
152189777a2SCristian Pallares The inner workings of the potrace algorithm are explained here:
153189777a2SCristian Pallares http://potrace.sourceforge.net/potrace.pdf
154189777a2SCristian Pallares
155189777a2SCristian Pallares The potrace library is documented here:
156189777a2SCristian Pallares http://potrace.sourceforge.net/potracelib.pdf
157189777a2SCristian Pallares
158189777a2SCristian PallaresCOPYRIGHT
159189777a2SCristian Pallares
160*b3fce824SCristian Pallarés Copyright (C) 2001-2017 Peter Selinger
161189777a2SCristian Pallares
162189777a2SCristian Pallares This program is free software; you can redistribute it and/or modify
163189777a2SCristian Pallares it under the terms of the GNU General Public License as published by
164189777a2SCristian Pallares the Free Software Foundation; either version 2 of the License, or (at
165189777a2SCristian Pallares your option) any later version.
166189777a2SCristian Pallares
167189777a2SCristian Pallares This program is distributed in the hope that it will be useful, but
168189777a2SCristian Pallares WITHOUT ANY WARRANTY; without even the implied warranty of
169189777a2SCristian Pallares MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
170189777a2SCristian Pallares General Public License for more details.
171189777a2SCristian Pallares
172189777a2SCristian Pallares You should have received a copy of the GNU General Public License
1731f13f311SSkyrpex along with this program; if not, write to the Free Software Foundation,
1741f13f311SSkyrpex Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1751f13f311SSkyrpex See also http://www.gnu.org/.
176189777a2SCristian Pallares
177189777a2SCristian Pallares See the file COPYING for details.
178189777a2SCristian Pallares
179189777a2SCristian PallaresGPG KEY
180189777a2SCristian Pallares
181189777a2SCristian Pallares The key fingerprint of Peter Selinger's GPG key is:
182189777a2SCristian Pallares 12A2 4B3C 3790 B688 E484  7A98 A68B CC37 CA31 696A
183189777a2SCristian Pallares This may be useful for authenticating future versions of Potrace.
184