LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pamsplit

splits a multi-image PAM/PNM stream into separate files

TLDR

Split a multi-image PAM/PNM stream into numbered files
$ pamsplit [input.pam] "[image%d.pam]"
copy
Pad the sequence number to a fixed width
$ pamsplit -padname [4] [input.pam] "[image%d.pam]"
copy
Use default filenames (image0.pam, image1.pam, ...)
$ pamsplit [input.pam]
copy
Read from stdin while writing numbered outputs
$ cat [stream.pnm] | pamsplit - "[frame%d.pnm]"
copy

SYNOPSIS

pamsplit [-padname digits] [inputfile] [outputpattern]

DESCRIPTION

pamsplit reads a Netpbm stream that contains multiple concatenated PAM, PNM, PBM, PGM, or PPM images and writes each image to a separate file. The output filenames are generated from a printf-style pattern that includes a %d for the image index.The tool is the inverse of pnmcat / pamcat and is part of the Netpbm package.

PARAMETERS

inputfile

Multi-image PAM/PNM input file. Use - or omit to read from stdin.
outputpattern
Output filename pattern containing a single %d which is replaced with the (zero-based) image index. Defaults to image%d.
-padname digits
Pad the sequence number with leading zeros to at least digits characters (so -padname 3 produces image000, image001, ...). Useful for ensuring lexicographic ordering of output files.

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

The output pattern must contain exactly one %d specifier. Existing files at the generated paths are silently overwritten. For PBM/PGM/PPM streams without alpha channels, pamsplit preserves the original format of each frame.

HISTORY

pamsplit is part of the Netpbm package by Bryan Henderson and others, and supersedes the older pnmsplit utility from PBMplus.

SEE ALSO

pamundice(1), pnmcat(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