.TL
Ppmlabel User Manual
.SH 1
ppmlabel
.LP
Updated: 15 April 2006
.br
Table Of Contents
.SH 2
NAME
.LP
ppmlabel - add text to a PPM image
.SH 2
SYNOPSIS
.LP
\fBppmlabel\fR
[\fB-angle\fR \fIangle\fR]
[\fB-background\fR { \fBtransparent\fR | \fIcolor\fR } ]
[\fB-color\fR \fIcolor\fR]
[\fB-file\fR \fIfilename\fR]
[\fB-size\fR
\fItextsize\fR]
[\fB-text\fR \fItext_string\fR]
[\fB-x\fR \fIcolumn\fR]
[\fB-y\fR \fIrow\fR]
...
[\fIppmfile\fR]
.SH 2
EXAMPLE
.LP
.DS L
ppmlabel -x 50 -y 50 -text hello \
-angle -30 -text there \
testimg.ppm
.DE
.SH 2
DESCRIPTION
.LP
.LP
This program is part of Netpbm.
.LP
\fBppmlabel\fR uses the text drawing facilities of \fBlibnetpbm\fR'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.
.LP
You can add any number of separate labels in a single invocation of
\fBppmlabel\fR, limited only by any restrictions your environment has
on the number and size of program arguments (e.g. a shell's command
size limit).
.LP
If you don't specify \fIppmfile\fR, \fBppmlabel\fR reads its input
PPM image from Standard Input.
.LP
The output image goes to Standard Output.
.LP
A more sophisticated way to add a label to an image is to use
\fBpbmtext\fR or \fBpbmtextps\fR to create an image of the text, then
\fBpamcomp\fR to overlay it onto the base image.
.LP
Another more general program is \fBppmdraw\fR. It is slightly harder
to use for simple labelling.
.SH 2
OPTIONS
.LP
.LP
The arguments on the \fBppmlabel\fR 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.
.LP
You can abbreviate any option to its shortest unique prefix.
.RS
.IP "\fB-angle\fR\fI angle\fR"
This option sets the angle of the baseline of subsequent text.
\fIangle\fR is an integral number of degrees, measured
counterclockwise from the row axis of the image.
.IP "\fB-background\fR { \fBtransparent\fR | \fIcolor\fR }"
If the argument is \fBtransparent\fR, \fBppmlabel\fR draws the
text over the existing pixels in the image. If you specify a
\fIcolor\fR (see the \fB-color\fR option below for information on
how to specify colors), \fBppmlabel\fR generates background rectangles
enclosing subsequent text, and those rectangles are filled with that
color.
.IP "\fB-color\fR \fIcolor\fR"
This option sets the color for subsequent text.
.LP
Specify the color (\fIcolor\fR) as described for the argument of the \fBppm_parsecolor()\fR
library routine.
.LP
\fB-colour\fR is an acceptable alternate spelling.
.IP "\fB-file\fR \fIfilename\fR"
This option causes \fBppmlabel\fR to read lines of text from the file
named \fIfilename\fR and draw it on successive lines.
.IP "\fB-size\fR \fItextsize\fR"
This option sets the height of the tallest characters above the
baseline to \fItextsize\fR pixels.
.IP "\fB-text\fR \fItext_string\fR"
This option causes \fBppmlabel\fR to draw the specified text
string. It advances the location for subsequent text down 1.75 times
the current \fItextsize\fR. That lets you draw multiple lines of
text in a reasonable manner without specifying the position of each
line.
.LP
Note that if you invoke \fBppmlabel\fR 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.
.DS L
$ ppmlabel -text "this is my text" baseimage.ppm >annotatedimage.ppm
.DE
.IP "\fB-x\fR \fIcolumn\fR"
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.
.IP "\fB-y\fR \fIrow\fR"
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.
.RE
.SH 2
LIMITATIONS
.LP
.LP
Text strings are restricted to 7 bit ASCII. The text font used by
\fBppmlabel\fR doesn't include definitions for 8 bit ISO 8859/1 characters.
.LP
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.
.SH 2
SEE ALSO
.LP
\fBppmmake\fR,
\fBppmdraw\fR,
\fBpbmtext\fR,
\fBpbmtextps\fR,
\fBpamcomp\fR,
\fBppm\fR
.SH 2
AUTHOR
.LP
Copyright (C) 1995 by John Walker (kelvin@fourmilab.ch)
.br
WWW home page: http://www.fourmilab.ch/
.br
.LP
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.
.br
\l'5i'
.SH 2
Table Of Contents
.LP
.IP \(bu
SYNOPSIS
.IP \(bu
EXAMPLE
.IP \(bu
DESCRIPTION
.IP \(bu
OPTIONS
.IP \(bu
LIMITATIONS
.IP \(bu
SEE ALSO
.IP \(bu
AUTHOR
.LP
|