Build a Photo CD Contact Sheet with pcdindex
You will turn a Photo CD overview file into a PPM contact sheet: one image containing reduced versions of the photographs and their annotations. Allow about 10 minutes if the disc is mounted and the Netpbm package is already installed. You need a readable overview.pcd file and enough space for the output.
The route
Jump straight to the step you need, or tick off Done means at the end.
1. Check the installed command
pcdindex is the old name for Netpbm's pcdovtoppm. On this machine, the former is a symbolic link to the latter. The installed package is Netpbm 2:11.05.02-1.1build1, and the executable's usage text is useful because the short option spelling in older documentation is not fully consistent.
$ command -v pcdindex
/usr/bin/pcdindex
$ ls -l /usr/bin/pcdindex
... /usr/bin/pcdindex -> pcdovtoppm
$ pcdindex
Usage: /usr/bin/pcdindex [-m W] [-s S] [-a A] [-c N|n] [-f F] [-b|-w] <overview.pcd>
The command prints usage when no input is supplied. It does not offer a conventional --help or --version screen in this installation. No elevated privilege is needed to read a mounted disc or write into a directory you own.
Checkpoint: locate the overview file
A Photo CD normally exposes the overview at a path such as /media/$USER/PHOTO_CD/overview.pcd. Replace the example with the path on your system. This check only reads directory metadata.
$ PCD='/path/to/overview.pcd'
$ test -r "$PCD" && printf 'readable: %s' "$PCD"
readable: /path/to/overview.pcd
If the test fails, check the mount point and filename. Do not create an empty file with that name: pcdindex needs the Photo CD overview data, not merely a file with the right suffix.
2. Generate the default contact sheet
Run the command with the overview file as its final argument and redirect standard output to a new PPM file.
$ pcdindex "$PCD" > overview.ppm
The default result is at most 1152 pixels wide, with each source image at most 192 pixels and up to six images across. The default background is black, and the built-in font is used for annotations. The program writes the image to standard output, so a missing or mistyped redirection can leave the terminal full of binary data.
Check the result as a Netpbm image before opening it in another tool:
$ pnmfile overview.ppm
overview.ppm: PPM raw, 1152 by 768 pixels, maxval 255
The dimensions depend on the number and layout of photographs, so treat the example line as a shape of expected output, not a promise of exact numbers. If pnmfile reports an error, inspect the command's diagnostics and the output file size before trying another conversion.
3. Fit more useful thumbnails on the page
Use -m for maximum output width, -s for the maximum size of each image, and -a for the maximum number across. These values control the index layout rather than changing the source photographs.
$ pcdindex -m 768 -s 96 -a 8 "$PCD" > overview-small.ppm
$ pnmfile overview-small.ppm
overview-small.ppm: PPM raw, ... pixels, maxval 255
The installed usage output gives defaults of 1152, 192 and 6 respectively. Smaller values make a compact sheet; larger values can make annotations and thumbnails easier to inspect but produce a larger image.
4. Choose colours and annotation options
Use -w for a white background. The default is -b, black. Use -c with a number to request a maximum number of colours, or with n to request no quantisation. Use -f with a font file when the built-in font is not suitable.
$ pcdindex -w -c n -f /path/to/smallfont.pbm "$PCD" > overview-white.ppm
The font file must exist and be readable. If you only need a normal contact sheet, omit -f; the internal font is the default. Options are short in the installed command, even though current upstream documentation also describes their longer forms such as -maxwidth and -white.
5. Convert a verified PPM when needed
PPM is a useful intermediate format, but a JPEG is often easier to share. Pipe the generated image directly to ppmtojpeg if you do not need to keep the PPM:
$ pcdindex "$PCD" | ppmtojpeg > overview.jpg
$ file overview.jpg
overview.jpg: JPEG image data, ...
For repeatable troubleshooting, keep overview.ppm as well. It lets you separate contact-sheet generation from later image conversion.
Common traps and recovery
- Wrong command name: use
pcdindexon this system, but expect documentation and newer scripts to call the same programpcdovtoppm. - Wrong option spelling: the local executable accepts
-mfor width. A legacypcdovtoppmman page may display a conflicting-w widthentry, while-wis the installed background-colour switch. Follow the local usage output. - Accidental overwrite: shell redirection truncates an existing destination before the program runs. Choose a new filename, or make a backup first:
cp --preserve=all overview.ppm overview.ppm.bak. To undo a test output, remove only the explicitly named generated file withrm -- overview-small.ppm; never remove the originaloverview.pcd. - Unreadable input: a missing mount, wrong case in the filename or insufficient permissions produces no useful index. Re-run
test -r "$PCD"and confirm that the disc is mounted.
Done means
pcdindexresolves to the installed Netpbm executable.- The input is a readable Photo CD
overview.pcdfile. - The generated PPM passes
pnmfileand has the intended layout options. - Any JPEG conversion is made from a verified PPM or a checked pipeline.