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.

INSTALL

sudo apt install netpbm
copy
sudo dnf install netpbm
copy
sudo pacman -S netpbm
copy
sudo apk add netpbm
copy
sudo zypper install netpbm
copy
brew install netpbm
copy
nix profile install nixpkgs#netpbm
copy

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)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid