LinuxCommandLibrary

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 labels
$ pnmindex -title [*.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

Size of each thumbnail.
-across n
Number of images per row.
-colors n
Number of colors.
-title
Add filenames as titles.
-black
Black background.
-quant
Quantize colors.

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 labels on black
pnmindex -title -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

pnmcat(1), pnmscale(1), pnmtile(1), netpbm(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard