LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pnmcat

Concatenate PNM images horizontally or vertically

TLDR

Concatenate horizontally
$ pnmcat -lr [image1.pnm] [image2.pnm] > [result.pnm]
copy
Concatenate vertically
$ pnmcat -tb [image1.pnm] [image2.pnm] > [result.pnm]
copy
With background color
$ pnmcat -lr -white [image1.pnm] [image2.pnm] > [result.pnm]
copy
Center alignment
$ pnmcat -tb -jcenter [image1.pnm] [image2.pnm] > [result.pnm]
copy

SYNOPSIS

pnmcat [options] pnmfiles...

DESCRIPTION

pnmcat concatenates multiple PNM images either horizontally or vertically. It's the image equivalent of cat for files.Handles images of different sizes with alignment and background options.

PARAMETERS

-lr

Left to right (horizontal).
-tb
Top to bottom (vertical).
-jleft, -jcenter, -jright
Horizontal justification.
-jtop, -jcenter, -jbottom
Vertical justification.
-white
White background.
-black
Black background.

EXAMPLES

$ # Side by side
pnmcat -lr left.ppm right.ppm > combined.ppm

# Stack vertically
pnmcat -tb top.ppm bottom.ppm > stacked.ppm

# Multiple images
pnmcat -lr img1.ppm img2.ppm img3.ppm > row.ppm

# Centered with white background
pnmcat -tb -jcenter -white small.ppm large.ppm > out.ppm
copy

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

All images must be same type (PBM, PGM, or PPM). Different depths are handled. Part of Netpbm.

HISTORY

pnmcat is part of Netpbm by Jef Poskanzer, providing image concatenation since early Pbmplus.

SEE ALSO

pamstack(1), pnmtile(1), pnmpaste(1), netpbm(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