LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pnmindex

Create thumbnail contact sheets from images

TLDR

Create image index
$ pnmindex [image1.pnm] [image2.pnm] [image3.pnm] > [index.pnm]
copy
Specify size
$ pnmindex -size [100] [*.pnm] > [index.pnm]
copy
With a title
$ pnmindex -title ["My Gallery"] [*.pnm] > [index.pnm]
copy
Multiple columns
$ pnmindex -across [4] [*.pnm] > [index.pnm]
copy

SYNOPSIS

pnmindex [options] pnmfiles...

DESCRIPTION

pnmindex creates a visual index (contact sheet) from multiple PNM images. Each image is scaled to a thumbnail and arranged in a grid.Useful for creating image previews and galleries.

PARAMETERS

-size n

Maximum thumbnail size in pixels. Each image is scaled to fit within an N x N box while preserving aspect ratio. Default: 100.
-across n
Number of thumbnails per row. Default: 6.
-colors n
Maximum number of colors in the output image. Default: 256.
-title title
Add a title string at the top of the image.
-black
Use black background with white labels instead of the default white background with black labels.
-noquant
Disable color quantization. By default, colors are reduced for PPM input.
-quant
Enable color quantization (default for PPM input).
-quiet
Suppress informational messages.

EXAMPLES

$ # Create index of all PPM files
pnmindex *.ppm > index.ppm

# Thumbnails 150 pixels, 5 across
pnmindex -size 150 -across 5 photos/*.ppm > gallery.ppm

# With title on black background
pnmindex -title "Photos" -black images/*.pnm > contact.ppm

# Convert to JPEG
pnmindex *.pnm | pnmtojpeg > index.jpg
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

Large numbers of images can produce huge output. Consider pamundice for splitting back.

HISTORY

pnmindex is part of Netpbm, providing contact sheet generation since early Pbmplus versions.

SEE ALSO

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