summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-tumbleweed/man1/ppmlabel.1
blob: 52d078827d4c88ab79604c746bbec5a435cfeaf1 (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
\
.\" 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 "Ppmlabel User Manual" 0 "15 April 2006" "netpbm documentation"

.SH NAME
ppmlabel - add text to a PPM image

.UN synopsis
.SH SYNOPSIS

\fBppmlabel\fP

[\fB-angle\fP \fIangle\fP]

[\fB-background\fP { \fBtransparent\fP | \fIcolor\fP } ]

[\fB-color\fP \fIcolor\fP]

[\fB-file\fP \fIfilename\fP]

[\fB-size\fP

\fItextsize\fP]

[\fB-text\fP \fItext_string\fP]

[\fB-x\fP \fIcolumn\fP]

[\fB-y\fP \fIrow\fP]

\&...

[\fIppmfile\fP]


.UN example
.SH EXAMPLE

.nf
\f(CW
    ppmlabel -x 50 -y 50 -text hello \e
             -angle -30 -text there \e
             testimg.ppm 
\fP

.fi

.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
\fBppmlabel\fP uses the text drawing facilities of \fBlibnetpbm\fP's
"ppmd" component to add text to a PBM image.  You control
the location, size, baseline angle, color of the text, and background
color (if any) with command line arguments.  You can specify the text
on the command line or supply it in files.
.PP
You can add any number of separate labels in a single invocation of
\fBppmlabel\fP, limited only by any restrictions your environment has
on the number and size of program arguments (e.g. a shell's command 
size limit).
.PP
If you don't specify \fIppmfile\fP, \fBppmlabel\fP reads its input
PPM image from Standard Input.
.PP
The output image goes to Standard Output.
.PP
A more sophisticated way to add a label to an image is to use
\fBpbmtext\fP or \fBpbmtextps\fP to create an image of the text, then
\fBpamcomp\fP to overlay it onto the base image.
.PP
Another more general program is \fBppmdraw\fP.  It is slightly harder
to use for simple labelling.

.UN options
.SH OPTIONS
.PP
In addition to the options common to all programs based on libnetpbm
(most notably \fB-quiet\fP, see 
.UR index.html#commonoptions
 Common Options
.UE
\&), \fBppmlabel\fP recognizes the following
command line options:
.PP
The arguments on the \fBppmlabel\fP command line are not options in
the strict sense; they are commands which control the placement and
appearance of the text being added to the input image.  They are
executed left to right, and any number of arguments may appear.
.PP
You can abbreviate any option to its shortest unique prefix.


.TP
\fB-angle\fP\fI angle\fP
This option sets the angle of the baseline of subsequent text.
\fIangle\fP is an integral number of degrees, measured
counterclockwise from the row axis of the image.

.TP
\fB-background\fP { \fBtransparent\fP | \fIcolor\fP }
If the argument is \fBtransparent\fP, \fBppmlabel\fP draws the
text over the existing pixels in the image.  If you specify a
\fIcolor\fP (see the \fB-color\fP option below for information on
how to specify colors), \fBppmlabel\fP generates background rectangles
enclosing subsequent text, and those rectangles are filled with that
color.

.TP
\fB-color\fP \fIcolor\fP
This option sets the color for subsequent text.
.sp
Specify the color (\fIcolor\fP) as described for the 
.UR libnetpbm_image.html#colorname
argument of the \fBpnm_parsecolor()\fP library routine
.UE
\&.
.sp
\fB-colour\fP is an acceptable alternate spelling.

.TP
\fB-file\fP \fIfilename\fP
This option causes \fBppmlabel\fP to read lines of text from the file
named \fIfilename\fP and draw it on successive lines.

.TP
\fB-size\fP \fItextsize\fP
This option sets the height of the tallest characters above the
baseline to \fItextsize\fP pixels.

.TP
\fB-text\fP \fItext_string\fP
This option causes \fBppmlabel\fP to draw the specified text
string.  It advances the location for subsequent text down 1.75 times
the current \fItextsize\fP.  That lets you draw multiple lines of
text in a reasonable manner without specifying the position of each
line.
.sp
Note that if you invoke \fBppmlabel\fP via a shell command and your
text string contains spaces, you'll have to quote it so the shell treats
the whole string as a single token.  E.g.
.nf
  $ ppmlabel -text "this is my text" baseimage.ppm >annotatedimage.ppm

.fi


.TP
\fB-x\fP \fIcolumn\fP
This option sets the pixel column at which subsequent text will
be left justified.  Depending on the shape of the first character, the
actual text may begin a few pixels to the right of this point.

.TP
\fB-y\fP \fIrow\fP
This option sets the pixel row which will form the baseline of
subsequent text.  Characters with descenders, such as "y," will extend
below this line.  



.UN limitations
.SH LIMITATIONS
.PP
Text strings are restricted to 7 bit ASCII.  The text font used by
\fBppmlabel\fP doesn't include definitions for 8 bit ISO 8859/1 characters.
.PP
When drawing multiple lines of text with a non-transparent
background, it should probably fill the space between the lines with
the background color.  This is tricky to get right when the text is
rotated to a non-orthogonal angle.

.UN seealso
.SH SEE ALSO
.BR "ppmmake" (1)\c
\&,
.BR "ppmdraw" (1)\c
\&,
.BR "pbmtext" (1)\c
\&,
.BR "pbmtextps" (1)\c
\&,
.BR "pamcomp" (1)\c
\&,
.BR "ppm" (5)\c
\&


.UN author
.SH AUTHOR

Copyright (C) 1995 by John Walker (\fIkelvin@fourmilab.ch\fP)
WWW home page: 
.UR http://www.fourmilab.ch/
http://www.fourmilab.ch/
.UE
\&
.PP
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby granted,
without any conditions or restrictions.  This software is provided
``as is'' without express or implied warranty.
.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/ppmlabel.html
.PP