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

Application Notes

161       A convenient way to view an SVG document is with a web  browser.   Many
162       understand  a file whose name ends in ".svg" to be an SVG image and can
163       render it.
164
165
166

SEE ALSO

168       pnmquant(1),          pbmclean(1),          pnm(1),           Autotrace
169http://autotrace.sourceforge.net
170
171

HISTORY

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

DOCUMENT SOURCE

190       This  manual  page was generated by the Netpbm tool 'makeman' from HTML
191       source.  The master documentation is at
192
193              http://netpbm.sourceforge.net/doc/pamtosvg.html
194
195netpbm documentation             23 April 2006         Pamtosvg User Manual(0)
Impressum