Make Cut-and-Glue Globe Strips from a PPM Image with ppmglobe
ppmglobe slices a cylindrical map projection into strips you can print, cut out and glue onto a sphere. It writes a new PPM image to standard output and never touches the source. Allow about fifteen minutes for the conversion, longer if you are also preparing a printable layout.
The route
Jump straight to the step you need, or tick off Done means at the end.
This guide uses the ppmglobe installed with Netpbm 11.5.2. The local manual page is dated 23 February 2006, so these examples describe the installed command's documented behaviour rather than assuming every Netpbm release is identical. You need the netpbm package, a readable cylindrical PPM map, and enough columns in that map for the number of strips you request.
1. Check the installed command and the input
Start with read-only checks. No elevated privileges are needed when the image is in a directory you can read and your destination is writable:
$ command -v ppmglobe
/usr/bin/ppmglobe
$ ppmglobe --version
ppmglobe: Using libnetpbm from Netpbm Version: Netpbm 11.5.2
$ pnmfile /path/to/cylindrical-map.ppm
/path/to/cylindrical-map.ppm: PPM raw, 2400 by 1200 maxval 255
Your version banner and pnmfile wording can differ. What matters is that the executable resolves, the input is recognised as PPM, and you know its width. ppmglobe expects a genuine cylindrical projection: a normal Mercator map is not automatically corrected into the right one.
Checkpoint
Record the width from pnmfile. The strip count must not be larger than that width. If the width does not divide evenly by the strip count, the command drops the unused columns at the right edge so every output strip is whole.
2. Choose a strip count
The first argument is the number of equal-width strips to generate. More strips reduce the stretching, tearing and crumpling caused by fitting flat paper around a sphere, but they also mean more cutting and gluing. Start with a count that divides the image width cleanly: for a 2400-column source, 24, 48 or 60 are straightforward choices.
Do not confuse strip count with output resolution or paper size. It controls how many gores are cut from the horizontal image, not how large the printed page will be. Test the geometry first, then set print scaling in your image or document application.
3. Generate the globe image into a new file
Pass the strip count and source filename, then redirect standard output to a new destination:
$ ppmglobe 48 /path/to/cylindrical-map.ppm > /path/to/globe-strips.ppm
$ pnmfile /path/to/globe-strips.ppm
/path/to/globe-strips.ppm: PPM raw, 2400 by 1200 maxval 255
The output stays a PPM image at the source dimensions in this check, with the strip boundaries and background encoded straight into the pixels. The command normally prints no progress report, because the image itself is the standard output.
Warning
Redirection with > truncates an existing destination before the program has finished. For an output you cannot afford to lose, write a temporary file and replace the old one only after verification:
$ ppmglobe 48 /path/to/cylindrical-map.ppm > /path/to/globe-strips.ppm.new
$ pnmfile /path/to/globe-strips.ppm.new
$ mv /path/to/globe-strips.ppm.new /path/to/globe-strips.ppm
The final mv is what actually changes the destination. If conversion fails, leave the original in place and inspect the error; remove the incomplete .new file only once you have confirmed it is disposable.
4. Use standard input when the map comes from a pipeline
The filename is optional. Without it, ppmglobe reads the PPM image from standard input, which lets you chain another Netpbm operation in front of it:
$ pnmcrop /path/to/cylindrical-map.ppm | ppmglobe 48 > /path/to/cropped-globe-strips.ppm
$ pnmfile /path/to/cropped-globe-strips.ppm
/path/to/cropped-globe-strips.ppm: PPM raw, 2400 by 1200 maxval 255
Only use this form when you know the preceding command produces a complete PPM stream. A broken or truncated pipeline can leave a partial output file even though the destination exists, so check the exit status and the resulting image before printing it.
5. Set the space between strips
The default background colour between strips is black. Choose another named colour with --background when black would blend into the artwork or be hard to see while cutting:
$ ppmglobe --background=white 48 /path/to/cylindrical-map.ppm > /path/to/globe-strips-white.ppm
The option can also be written with a space, as --background white. The manual accepts unique option abbreviations, but full names read better in scripts and instructions. Colour names are parsed by Netpbm, so use a name your installed colour parser accepts.
Some image formats cannot represent a requested named colour exactly at their selected precision. Without --closeok, ppmglobe fails rather than silently substituting a nearby colour:
$ ppmglobe --background=white --closeok 48 /path/to/cylindrical-map.ppm > /path/to/globe-strips-white.ppm
That flag is a rendering choice, not a repair for a malformed input. If the exact background matters for compositing or a cutting template, omit --closeok and treat a failure as a reason to pick a representable colour or inspect the PPM maxval.
6. Handle the common failures
If the command says there are too few columns for the requested strips, lower the count or use a wider source. Asking for four strips from a three-column image fails outright, because a fractional or empty strip cannot be produced:
$ ppmglobe 4 /path/to/three-column.ppm > /tmp/test.ppm
ppmglobe: You asked for 4 strips, but the image is only 3 pixels wide, so that is impossible.
- Uneven width means a truncated edge. If the image width does not divide evenly, the rightmost remainder is dropped. Easy to miss when the map carries an important edge or a longitude seam, so pick a clean divisor or inspect the output before printing it.
- Unreadable input needs a permissions check, not sudo. Check the path and permissions first:
$ ls -l /path/to/cylindrical-map.ppm
$ test -r /path/to/cylindrical-map.ppm && echo readable
Reach for elevated privileges only if your system administrator has deliberately placed the input or destination behind an access boundary; the conversion itself does not need root. Keep the original map until the strips have been viewed and the output dimensions checked.
Done means
- Command and version checked.
ppmglobeand the Netpbm version were confirmed on the target machine. - Input confirmed cylindrical. The source is a readable cylindrical PPM projection, and its width is known.
- Strip count sensible. No greater than the source width, ideally a clean divisor.
- Output verified before printing. The result was redirected to a new file and checked with
pnmfile. - Background settings deliberate. The background colour and
--closeokchoice match the accuracy you actually need. - Original preserved. The source image stays available if the strips need regenerating.