tutorial / Dec 4, 2026

Make a Contact Sheet for a Box of Scanned Photos

Build a four-print visual index from copies of scans on a home server. Verify it against the physical box without importing another album or editing a master.

By Stackarr EditorialImageMagick · photo archive · contact sheets · digitization
A print layout becomes a tiled proof that is checked against the box.
Use physical order to connect four scans to their prints.

What belongs on the index

A box of prints and a directory of scans are easy to reconcile until two frames look almost identical. A contact sheet gives the person holding the box something better than filenames: four pictures in a fixed order. For a homelab with a self-hosted photo library, the index belongs beside the inventory rather than in the album itself. Its purpose is to find a print, not to judge focus or replace a full-resolution scan.

Start with four loose prints whose order is known. Lay them out two across, starting in the upper left. Note a distinguishing detail for each: the open door, the bicycle with a basket, the empty chair, the cat facing away. Those details will catch a swapped pair even if the resulting file opens perfectly.

Prerequisites

Use a workstation with a POSIX shell and ImageMagick 7. Run magick -version and look for ImageMagick 7. This recipe assumes four trusted single-image JPEG scans already upright without automatic orientation correction. Use modest inputs: a small final JPEG does not mean large scans will be cheap to decode on a low-memory mini PC.

Leave the NAS archive mounted read-only. If your photo library runs in a Docker container, keep the proof folder outside its bind mounts: the service does not need access to these copies. Likewise, avoid the home server's watched import directory or the index can turn up in the family timeline as a fifth photograph. Confirm the location rather than assuming every home directory is local.

Setup

  1. In a private local home directory, run mkdir -m 700 "$HOME/print-box-proof". If it exists, stop: it may contain another session's output. Open the new folder in your file manager and copy in the four scans. Name only the copies 01.jpg, 02.jpg, 03.jpg and 04.jpg in physical reading order.
  2. Run cd "$HOME/print-box-proof" and check pwd. Stop if that is not the new folder. Run magick identify 01.jpg 02.jpg 03.jpg 04.jpg. Expect four JPEG entries with plausible scan dimensions. A missing file or decoder warning is a reason to inspect the copy, not to run the next command against the archive.
  3. Confirm there is no box-index.jpg in the folder. Run magick montage -background white -tile 2x2 -geometry 320x320+8+8 01.jpg 02.jpg 03.jpg 04.jpg box-index.jpg. The montage guide illustrates the geometry syntax: the dimensions bound the previews and the positive offsets leave space around them. Explicit names keep the order independent of a directory listing.
  4. Open box-index.jpg locally. Read left to right across the top, then across the bottom. Write that order on a slip for the box, not on the prints. Include the box identifier so that someone finding the sheet later knows which originals to retrieve.
Upper and lower row labels map scan numbers to positions on the proof.
Read across each row before moving down.

Verification

Run magick identify box-index.jpg. The identify reference explains the format and dimensions. Expect one JPEG entry rather than four entries. That is the file-level check. It cannot tell whether the cyclist belongs in the second slot. Match each preview to its print using the distinguishing details noted before setup. A portrait can have more white space beside it than a landscape without anything being missing. Check its edges against the original.

Match, swap and unreadable outcomes separate order errors from scan defects.
A valid JPEG does not prove the order is correct.

Troubleshooting

If two previews are swapped, open the numbered copies individually. If the copies themselves are in the wrong order, correct their mapping from the scans in a fresh workspace. Don't reorder the physical prints to make the test pass. If one preview is sideways, compare its copy in a viewer with orientation correction disabled. The option reference distinguishes orientation operations from resizing; changing tile dimensions will not straighten a rotated scan.

A pale border can disappear against a white background. That is not enough evidence to crop the master. For a second proof, use the same copies, substitute gray for white, and choose a new unused output name. Compare at the same zoom. If decoding fails or memory runs short, stop and use smaller working copies rather than relaxing system limits.

Rollback and recovery

To roll back, close the viewer and move only the newly created proof folder to the local trash. Check its location and contents first. No archive file needs restoring because the sheet was built from copies. If the proof was useful, retain it with a list mapping positions to archival filenames before discarding the numbered copies. Store it outside watched imports. The sheet then remains an index rather than another item the next cataloguing session has to explain.

Verification ledger

Sources and further reading

  1. Command-line Tools: MontageImageMagick · Primary source
  2. Command-line Tools: IdentifyImageMagick · Primary source
  3. Command-line OptionsImageMagick · Primary source