summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-leap-15-6/man1/pamtosvg.1
blob: b43cda97f28b8d88db0a881a7322d9fd7260c953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
\
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
.\" Do not hand-hack it!  If you have bug fixes or improvements, please find
.\" the corresponding HTML page on the Netpbm website, generate a patch
.\" against that, and send it to the Netpbm maintainer.
.TH "Pamtosvg User Manual" 0 "23 April 2006" "netpbm documentation"

.SH NAME
pamtosvg - convert a Netpbm image to a SVG (Scalable Vector Graphics) image

.UN synopsis
.SH SYNOPSIS

\fBpamtosvg\fP

[\fB-background-color=\fP\fIcolorname\fP]
[\fB-centerline\fP]
[\fB-corner-threshold=\fP\fIangle\fP]
[\fB-corner-always-threshold=\fP\fIangle\fP]
[\fB-corner-surround=\fP\fIinteger\fP]
[\fB-tangent-surround=\fP\fIinteger\fP]
[\fB-error-threshold=\fP\fIfloat\fP]
[\fB-filter-iterations=\fP\fIcount\fP]
[\fB-line-reversion-threshold=\fP\fIfloat\fP]
[\fB-line-threshold=\fP\fIfloat\fP]
[\fB-width-weight-factor=\fP\fIfloat\fP]
[\fB-preserve-width\fP]
[\fB-remove-adjacent-corners\fP]
[\fB-log\fP]
[\fB-report-progress\fP] [\fIpnmfile\fP]
.PP
Minimum unique abbreviation of option is acceptable.  You may use
double hyphens instead of single hyphen to denote options.  You may use
white space in place of the equals sign to separate an option name
from its value.

.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
\fBpamtosvg\fP reads a PNM image as input and produce an SVG
(Scalable Vector Graphics) image as output.  Thus, it traces curves
in the input image and creates a set of splines that represent the
image.
.PP
SVG is a vector image format, which means it describes curves that
compose an image.  By contrast, PNM is a raster format, which means it
describes dots that compose an image.  The main practical difference
between the two types is that you can scale vector images better.  A
vector image also takes a lot less data to describe an image if the
image is composed of simple curves.
.PP
That means it is really an understatement to say that \fBpamtosvg\fP
is an image format converter.  It's really an image tracer.  Its main job
is to trace a raster image and find the lines in it.  It then represents
its findings in SVG format.
.PP
\fBpamtosvg\fP does the same kind of thing that StreamLine,
CorelTrace, and Autotrace do.  It is in fact derived from Autotrace.
.PP
SVG is a gigantic format, capable of amazing things.  \fBpamtosvg\fP
exploits only a morsel of it.  The SVG image produced by \fBpamtosvg\fP
consists of a single <svg> element, which has a "width"
attribute and a "height" attribute.  The value of that element
is composed of <path> elements.  That's it.
.PP
In the SVG output, distances are unitless, with one unit corresponding
to one pixel of the input.
.PP
So that \fBpamtosvg\fP will find simple curves in the image, you
may want to remove speckles from it with \fBpbmclean\fP and consolidate
multiple shades into single colors with \fBpnmquant\fP first.
.PP
For more information on SVG, see 
.UR http://www.w3.org/Graphics/SVG/
the Worldwide Web Consortium's SVG web page
.UE
\&.


.UN options
.SH OPTIONS


.TP
\fB-background-color=\fP\fIcolorname\fP
Treat the specified color as the background color and ignore it.
.sp
If you don't specify this option, \fBpamtosvg\fP does not recognize
any background color.
.sp
Specify the color (\fIcolorname\fP) as described for the 
.UR libppm.html#colorname
argument of the \fBppm_parsecolor()\fP library routine
.UE
\&.

.TP
\fB-centerline\fP
Trace an object's centerline.
.sp
By default, \fBpamtosvg\fP traces an object's outline.

.TP
\fB-corner-always-threshold=\fP\fIangle\fP
Consider any angle at a pixel which falls below angle \fIangle\fP
(in decimal floating point degrees) as a corner, even if it is
bordered by other corner pixels.  Default is 60 degrees.

.TP
\fB-corner-surround=\fP\fIinteger\fP
Consider the specified number of pixels on either side of a
point when determining if that point is a corner.  Default is 4.

.TP
\fB-corner-threshold=\fP\fIangle\fP
Consider any pixel which forms an angle with its predecessors and
successors that is smaller than \fIangle\fP (in decimal floating
point degrees) as a corner.  Default is 100.

.TP
\fB-error-threshold=\fP\fIfloat\fP
Subdivide fitted curves that are offset by a number of pixels
exceeding the specified number.  Default is 2.0.

.TP
\fB-filter-iterations=\fP\fIinteger\fP
Smooth the curve the specified number of times prior to fitting
Default is 4.

.TP
\fB-line-reversion-threshold=\fP\fIfloat\fP
When a spline is closer to a straight line than the specified real
number weighted by the square of the curve length, maintain it as a
straight line, even if it is a list with curves.
.sp
Default is .01.

.TP
\fB-line-threshold=\fP\fIfloat\fP
If a spline does not deviate from the straight line defined by its
endpoints by more than the specified number of pixels, then treat it
as a straight line.
.sp
Default is 1.

.TP
\fB-log\fP
Create a log of the curve tracing process (suitable for
debugging).  Put it in the file named \fIinputfile\fP\fB.log\fP in
the current directory, where \fIinputfile\fP is the root of the input
file name, or "pamtosvg" if the input is from Standard Input
or a file with a weird name.

.TP
\fB-preserve-width\fP
Preserve line width prior to thinning.  Meaningful only with
\fB-centerline\fP.

.TP
\fBremove-adjacent-corners\fP
Remove adjacent corners.

.TP
\fB-report-progress\fP
Report the progress of the tracing to Standard Error as it happens.

.TP
\fB-tangent-surround\fP
Consider the specified number of points to either side of a point
when computing the tangent at that point.  Default is 3.

.TP
\fB-width-weight-factor\fP
Weight factor for fitting the linewidth.




.UN applicationnotes
.SH Application Notes
.PP
A convenient way to view an SVG document is with a web browser.  Many
understand a file whose name ends in ".svg" to be an SVG
image and can render it.


.UN seealso
.SH SEE ALSO
.BR "pnmquant" (1)\c
\&,
.BR "pbmclean" (1)\c
\&,
.BR "pnm" (5)\c
\&,
.UR http://autotrace.sourceforge.net
Autotrace
.UE
\&

.UN history
.SH HISTORY
.PP
\fBpamtosvg\fP was added to Netpbm in Version 10.33 (March 2006).
.PP
The core of \fBpamtosvg\fP -- the curve tracing logic -- was taken
nearly unmodified from Martin Weber's Autotrace program.  That program
duplicates a lot of Netpbm function, so \fBpamtosvg\fP is a much leaner
program.
.PP
Bryan Henderson created \fBpamtosvg\fP, basically just by adapting
Autotrace to Netpbm.
.PP
Autotrace was first released in 2000 and updates were released
through 2002.  A number of people wrote the code in it, but Masatake
Yamato and Martin Weber appear to be the principal creators of it.
.PP
As of June 2006, there was a 
.UR http://autotrace.sourceforge.net
Sourceforge project
.UE
\& for it.
.SH DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML
source.  The master documentation is at
.IP
.B http://netpbm.sourceforge.net/doc/pamtosvg.html
.PP