# man > ppmlabel(1)

> **TLDR:** Add text to a PPM image.
>
- Add text to a PPM image at the specified location:
  `ppmlabel -x {{pos_x}} -y {{pos_y}} {{-t|-text}} {{text}} {{path/to/input_file.ppm}} > {{path/to/output_file.ppm}}`
- Add multiple texts at different locations:
  `ppmlabel -x {{pos_x1}} -y {{pos_y1}} {{-t|-text}} {{text1}} -x {{pos_x2}} -y {{pos_y2}} {{-t|-text}} {{text2}} {{path/to/input_file.ppm}} > {{path/to/output_file.ppm}}`
- Specify the line color, the background color, the tilt, and the size of the added text:
  `ppmlabel -x {{pos_x}} -y {{pos_y}} {{-c|-color}} {{line_color}} {{-b|-background}} {{background_color}} {{-a|-angle}} {{tilt}} {{-s|-size}} {{size}} {{-t|-text}} {{text}} {{path/to/input_file.ppm}} > {{path/to/output_file.ppm}}`

*Source: tldr-pages*

---

_Ppmlabel_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)                General Commands Manual               _Ppmlabel_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)

## NAME
       ppmlabel - add text to a PPM image


## SYNOPSIS
### ppmlabel

       [**-angle _**angle_]

       [**-background **{ **transparent **| _color_ } ]

       [**-color _**color_]

       [**-file _**filename_]

       [**-size**

       _textsize_]

       [**-text _**text_string_]

       [**-x _**column_]

       [**-y _**row_]

       ...

       [_ppmfile_]



## EXAMPLE
           ppmlabel -x 50 -y 50 -text hello \
                    -angle -30 -text there \
                    testimg.ppm



## DESCRIPTION
       This program is part of [**Netpbm**(1)](https://www.chedong.com/phpMan.php/man/Netpbm/1/markdown).

       **ppmlabel  **uses  the  text drawing facilities of **libnetpbm**'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.

       You can add any number of separate labels in a single invocation of **ppmlabel**, limited only by
       any  restrictions  your  environment  has on the number and size of program arguments (e.g. a
       shell's command size limit).

       If you don't specify _ppmfile_, **ppmlabel **reads its input PPM image from Standard Input.

       The output image goes to Standard Output.

       A more sophisticated way to add a label to an image is to use **pbmtext **or **pbmtextps **to  create
       an image of the text, then **pamcomp **to overlay it onto the base image.

       Another more general program is **ppmdraw**.  It is slightly harder to use for simple labelling.


## OPTIONS
       In  addition  to  the options common to all programs based on libnetpbm (most notably **-quiet**,
       see ]8;;index.html#commonoptions\ Common Options]8;;\ ), **ppmlabel **recognizes the following command line options:

       The arguments on the **ppmlabel **command line are not options in the strict sense; they are com‐
       mands 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.

       You can abbreviate any option to its shortest unique prefix.



### -angle _
              This  option  sets the angle of the baseline of subsequent text.  _angle_ is an integral
              number of degrees, measured counterclockwise from the row axis of the image.


### -background 
              If the argument is **transparent**, **ppmlabel **draws the text over the  existing  pixels  in
              the image.  If you specify a _color_ (see the **-color **option below for information on how
              to  specify  colors),  **ppmlabel  **generates  background rectangles enclosing subsequent
              text, and those rectangles are filled with that color.


### -color _
              This option sets the color for subsequent text.

              Specify the color (_color_) as described  for  the  ]8;;libnetpbm_image.html#colorname\argument of the **pnm_parsecolor() **li‐
              brary routine]8;;\ .

              **-colour **is an acceptable alternate spelling.


### -file _
              This  option  causes  **ppmlabel  **to read lines of text from the file named _filename_ and
              draw it on successive lines.


### -size _
              This option sets the height of the tallest characters above the baseline  to  _textsize_
              pixels.


### -text _
              This  option causes **ppmlabel **to draw the specified text string.  It advances the loca‐
              tion for subsequent text down 1.75 times the current _textsize_.   That  lets  you  draw
              multiple  lines of text in a reasonable manner without specifying the position of each
              line.

              Note that if you invoke **ppmlabel **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 to‐
              ken.  E.g.
                $ ppmlabel -text "this is my text" baseimage.ppm >annotatedimage.ppm




### -x _
              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.


### -y _
              acters with descenders, such as "y," will extend below this line.




## LIMITATIONS
       Text strings are restricted to 7 bit ASCII.  The text font used by **ppmlabel  **doesn't  include
       definitions for 8 bit ISO 8859/1 characters.

       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.


## SEE ALSO
       [**ppmmake**(1)](https://www.chedong.com/phpMan.php/man/ppmmake/1/markdown), [**ppmdraw**(1)](https://www.chedong.com/phpMan.php/man/ppmdraw/1/markdown), [**pbmtext**(1)](https://www.chedong.com/phpMan.php/man/pbmtext/1/markdown), [**pbmtextps**(1)](https://www.chedong.com/phpMan.php/man/pbmtextps/1/markdown), [**pamcomp**(1)](https://www.chedong.com/phpMan.php/man/pamcomp/1/markdown), [**ppm**(1)](https://www.chedong.com/phpMan.php/man/ppm/1/markdown)



## AUTHOR
       Copyright (C) 1995 by John Walker (<_kelvin@fourmilab.ch_>)  WWW  home  page:  ]8;;<http://www.fourmilab.ch/>\<http://www.fourmi>‐
       lab.ch/]8;;\

       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.

## DOCUMENT SOURCE
       This  manual  page  was  generated by the Netpbm tool 'makeman' from HTML source.  The master
       documentation is at

              **<http://netpbm.sourceforge.net/doc/ppmlabel.html>**

netpbm documentation                        15 April 2006                    _Ppmlabel_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)
