LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ppmlabel

Add text labels to PPM images

TLDR

Add text label to image
$ ppmlabel -text "[Hello World]" [input.ppm] > [output.ppm]
copy
Add label at specific position
$ ppmlabel -x [10] -y [20] -text "[Label]" [input.ppm] > [output.ppm]
copy
Add label with custom color and size
$ ppmlabel -color [white] -size [24] -text "[Label]" [input.ppm] > [output.ppm]
copy
Add rotated label
$ ppmlabel -angle [45] -text "[Watermark]" [input.ppm] > [output.ppm]
copy
Add label with background highlight
$ ppmlabel -background [black] -color [yellow] -text "[Warning]" [input.ppm] > [output.ppm]
copy
Add multiple labels using a script file
$ ppmlabel -file [labels.txt] [input.ppm] > [output.ppm]
copy

SYNOPSIS

ppmlabel [options] [file]

DESCRIPTION

ppmlabel adds text labels to PPM (Portable Pixmap) images. It reads a PPM image, renders one or more text strings at specified positions with optional color, size, and rotation, and writes the result as a new PPM image. Part of the Netpbm toolkit.Multiple labels can be placed on a single image by specifying multiple -text options or by using the -file option to read label specifications from a file. Each label can have independent position, color, size, and angle settings.

PARAMETERS

-text string

Text string to render on the image.
-file filename
Read label commands from a file, one per line.
-x pixels
Horizontal position of the label from the left edge.
-y pixels
Vertical position of the label baseline from the top edge.
-color color
Text color (Netpbm color name or #rrggbb hex value).
-background color
Background color behind the text. Default is transparent (no background).
-angle degrees
Rotation angle in degrees counterclockwise. Default is 0.
-size pixels
Font height in pixels. Default depends on the built-in font.

CAVEATS

Uses a built-in bitmap font; does not support TrueType or external fonts. For more advanced text rendering, consider pbmtext piped through pnmcomp. Input and output are PPM format only.

SEE ALSO

pbmtext(1), pnmcomp(1), ppmdraw(1), ppmchange(1)

Copied to clipboard
Kai