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

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

Copied to clipboard
Kai