1Pamtosvg User Manual(0)                                Pamtosvg User Manual(0)
2
3
4

NAME

6       pamtosvg  -  convert a Netpbm image to a SVG (Scalable Vector Graphics)
7       image
8
9

SYNOPSIS

11       pamtosvg
12
13       [-background-color=colorname]  [-centerline]  [-corner-threshold=angle]
14       [-corner-always-threshold=angle]  [-corner-surround=integer] [-tangent-
15       surround=integer]  [-error-threshold=float]  [-filter-iterations=count]
16       [-line-reversion-threshold=float]    [-line-threshold=float]   [-width-
17       weight-factor=float]    [-preserve-width]    [-remove-adjacent-corners]
18       [-log] [-report-progress] [pnmfile]
19
20       Minimum  unique abbreviation of option is acceptable.  You may use dou‐
21       ble hyphens instead of single hyphen to denote options.   You  may  use
22       white space in place of the equals sign to separate an option name from
23       its value.
24
25

DESCRIPTION

27       This program is part of Netpbm(1).
28
29       pamtosvg reads a PNM image as input and produce an SVG (Scalable Vector
30       Graphics)  image  as output.  Thus, it traces curves in the input image
31       and creates a set of splines that represent the image.
32
33       SVG is a vector image format, which means it describes curves that com‐
34       pose  an  image.   By  contrast, PNM is a raster format, which means it
35       describes dots that compose an image.  The  main  practical  difference
36       between  the  two  types is that you can scale vector images better.  A
37       vector image also takes a lot less data to describe  an  image  if  the
38       image is composed of simple curves.
39
40       That  means  it  is really an understatement to say that pamtosvg is an
41       image format converter.  It's really an image tracer.  Its main job  is
42       to  trace  a raster image and find the lines in it.  It then represents
43       its findings in SVG format.
44
45       pamtosvg does the same kind of thing that StreamLine,  CorelTrace,  and
46       Autotrace do.  It is in fact derived from Autotrace.
47
48       SVG is a gigantic format, capable of amazing things.  pamtosvg exploits
49       only a morsel of it.  The SVG image produced by pamtosvg consists of  a
50       single  <svg>  element,  which  has  a "width" attribute and a "height"
51       attribute.  The value of that element is composed of  <path>  elements.
52       That's it.
53
54       In  the SVG output, distances are unitless, with one unit corresponding
55       to one pixel of the input.
56
57       So that pamtosvg will find simple curves in the image, you may want  to
58       remove  speckles  from it with pbmclean and consolidate multiple shades
59       into single colors with pnmquant first.
60
61       For more information on SVG, see the Worldwide Web Consortium's SVG web
62       page ⟨http://www.w3.org/Graphics/SVG/⟩ .
63
64
65

OPTIONS

67       In  addition  to  the options common to all programs based on libnetpbm
68       (most notably -quiet, see
69        Common Options ⟨index.html#commonoptions⟩ ), pamtosvg  recognizes  the
70       following command line options:
71
72
73
74       -background-color=colorname
75              Treat the specified color as the background color and ignore it.
76
77              If  you  don't  specify this option, pamtosvg does not recognize
78              any background color.
79
80              Specify the color (colorname) as described for the  argument  of
81              the           pnm_parsecolor()          library          routine
82              ⟨libnetpbm_image.html#colorname⟩ .
83
84
85       -centerline
86              Trace an object's centerline.
87
88              By default, pamtosvg traces an object's outline.
89
90
91       -corner-always-threshold=angle
92              Consider any angle at a pixel which falls below angle angle  (in
93              decimal  floating point degrees) as a corner, even if it is bor‐
94              dered by other corner pixels.  Default is 60 degrees.
95
96
97       -corner-surround=integer
98              Consider the specified number of pixels  on  either  side  of  a
99              point when determining if that point is a corner.  Default is 4.
100
101
102       -corner-threshold=angle
103              Consider  any  pixel  which forms an angle with its predecessors
104              and successors that is smaller than angle (in  decimal  floating
105              point degrees) as a corner.  Default is 100.
106
107
108       -error-threshold=float
109              Subdivide  fitted  curves  that are offset by a number of pixels
110              exceeding the specified number.  Default is 2.0.
111
112
113       -filter-iterations=integer
114              Smooth the curve the specified number of times prior to  fitting
115              Default is 4.
116
117
118       -line-reversion-threshold=float
119              When  a  spline  is closer to a straight line than the specified
120              real number weighted by the square of the curve length, maintain
121              it as a straight line, even if it is a list with curves.
122
123              Default is .01.
124
125
126       -line-threshold=float
127              If  a  spline does not deviate from the straight line defined by
128              its endpoints by more than the specified number of pixels,  then
129              treat it as a straight line.
130
131              Default is 1.
132
133
134       -log   Create  a  log of the curve tracing process (suitable for debug‐
135              ging).  Put it in the file named inputfile.log  in  the  current
136              directory,  where  inputfile is the root of the input file name,
137              or "pamtosvg" if the input is from Standard Input or a file with
138              a weird name.
139
140
141       -preserve-width
142              Preserve  line  width  prior  to thinning.  Meaningful only with
143              -centerline.
144
145
146       remove-adjacent-corners
147              Remove adjacent corners.
148
149
150       -report-progress
151              Report the progress of the tracing to Standard Error as it  hap‐
152              pens.
153
154
155       -tangent-surround
156              Consider  the  specified  number  of  points to either side of a
157              point when computing the tangent at that point.  Default is 3.
158
159
160       -width-weight-factor
161              Weight factor for fitting the linewidth.
162
163
164
165

APPLICATION NOTES

167       A convenient way to view an SVG document is with a web  browser.   Many
168       understand  a file whose name ends in ".svg" to be an SVG image and can
169       render it.
170
171
172

SEE ALSO

174       pnmquant(1),          pbmclean(1),          pnm(1),           Autotrace
175http://autotrace.sourceforge.net
176
177

HISTORY

179       pamtosvg was added to Netpbm in Version 10.33 (March 2006).
180
181       The  core  of  pamtosvg  -- the curve tracing logic -- was taken nearly
182       unmodified from Martin Weber's Autotrace program.  That program  dupli‐
183       cates a lot of Netpbm function, so pamtosvg is a much leaner program.
184
185       Bryan  Henderson created pamtosvg, basically just by adapting Autotrace
186       to Netpbm.
187
188       Autotrace was first released in 2000 and updates were released  through
189       2002.  A number of people wrote the code in it, but Masatake Yamato and
190       Martin Weber appear to be the principal creators of it.
191
192       As   of    June    2006,    there    was    a    Sourceforge    project
193http://autotrace.sourceforge.net⟩  for it.
194

DOCUMENT SOURCE

196       This  manual  page was generated by the Netpbm tool 'makeman' from HTML
197       source.  The master documentation is at
198
199              http://netpbm.sourceforge.net/doc/pamtosvg.html
200
201netpbm documentation             23 April 2006         Pamtosvg User Manual(0)
Impressum