Found an old HIPS image file and no modern tool that opens it? hipstopgm turns it into a plain PGM without touching the source. This guide covers the installed Netpbm 11.5.2 command on this machine, converting a HIPS image into PGM, and where the image data actually goes when you use a pipe or shell redirection. Allow about ten minutes if the HIPS file is already available.
You need a shell, the netpbm package, and a readable HIPS file. The normal examples are unprivileged: do not use sudo unless the input or output directory is deliberately restricted by your system's permissions.
Confirm which executable the shell will run and record its version:
$ command -v hipstopgm
/usr/bin/hipstopgm
$ hipstopgm --version
hipstopgm: Using libnetpbm from Netpbm Version: Netpbm 11.5.2
The version output carries build details alongside the library version, and the exact wording varies between package builds. The useful check is simply that the command is present and reports the Netpbm version you expect.
Checkpoint: keep the source file and the destination in separate paths. hipstopgm writes its PGM image to standard output, so a command that only prints diagnostics may still be sending the image stream somewhere you did not intend.
Give the input path as the optional positional argument and redirect standard output to a new file:
$ hipstopgm /path/to/input.hips > converted.pgm
$ printf 'exit status: %s\n' "$?"
exit status: 0
A status of zero means the conversion completed. There is normally no progress message, because the image itself is the standard output, and the input HIPS file is read, never rewritten.
Verify the result before opening or passing it to another image tool:
$ test -s converted.pgm && echo 'PGM output is non-empty'
PGM output is non-empty
$ file converted.pgm
converted.pgm: Netpbm image data, ...
The description file prints depends on its own version and on the image. A non-empty file is only a first check: confirm the dimensions and content with a trusted PGM-aware tool before you delete the original.
A HIPS file can hold more than one frame in sequence. hipstopgm concatenates those frames vertically into the resulting PGM, so a multi-frame source does not become several separate PGM files, and the output height can be well beyond the height of a single frame.
If the output looks unexpectedly tall, inspect the source's HIPS metadata with a tool that understands the format and check the PGM's dimensions before assuming something went wrong. Do not crop or overwrite the source just to make the result fit a viewer; establish first whether the extra height is the documented frame concatenation.
Checkpoint: treat the output as one PGM image. If a later workflow needs individual frames, split or process that image with a separate tool once you have preserved the original conversion.
The filename is optional. Omit it and hipstopgm reads the HIPS data from standard input, while standard output still carries the PGM image:
$ cat /path/to/input.hips | hipstopgm > converted.pgm
$ test -s converted.pgm && echo 'pipeline produced output'
pipeline produced output
A direct filename is easier to review and skips an unnecessary cat process, but standard input earns its keep when another program produces or filters the HIPS stream. Keep diagnostics separate from the image stream: do not pipe the PGM into a terminal or mix status text into the file.
The command takes no options specific to HIPS conversion. The installed manual says it recognises common libnetpbm options, but those are separate from the converter's positional input, so check the local manual before adding one to a script:
$ man hipstopgm
Shell redirection with > truncates its destination before hipstopgm even starts. If converted.pgm already holds a useful image, do not run the earlier command against it blindly. Write a temporary result beside it and replace the old file only after checking the status:
$ hipstopgm /path/to/input.hips > converted.pgm.new
$ status=$?
$ if [ "$status" -eq 0 ] && [ -s converted.pgm.new ]; then
> mv converted.pgm.new converted.pgm
> else
> printf 'conversion failed with status %s\n' "$status" >&2
> rm -f converted.pgm.new
> exit "$status"
> fi
Recovery: the mv step only replaces the destination after a successful, non-empty result. For an important image, copy the existing PGM to a clearly named backup before running this workflow, and only remove that backup once the replacement has been checked; deleting it is irreversible.
A missing file is an input or permission problem, not a reason to run the converter as root. Check the path without changing anything:
$ ls -l /path/to/input.hips
$ test -r /path/to/input.hips && echo 'input is readable'
For a deliberately missing path, the installed command reports that it cannot open the file and exits with status 1. Empty or malformed input also fails rather than producing a valid PGM:
$ hipstopgm /path/to/missing.hips > failed.pgm
hipstopgm: Unable to open file '/path/to/missing.hips' for reading. ...
$ printf 'exit status: %s\n' "$?"
exit status: 1
The precise diagnostic includes the path and system error text, so it can differ on another host. Check the exit status immediately, before another command overwrites it. Remove an incomplete output only once you have identified it as disposable, and keep the source HIPS file while you validate the PGM.
hipstopgm resolves to the expected Netpbm build.