Home / Alt manpages / infotopam(1)

  • infotopam(1)
  • User command
  • linux

Convert Amiga .info Icons to PAM with infotopam

Dig an old Amiga .info icon out of a backup and infotopam turns it into a PAM image you can actually open. Allow about ten minutes once the input file is ready. The commands below use the netpbm package and write image data to a new file; they do not touch the source icon.

1. Check the installed command and input

This guide follows the infotopam(1) behaviour installed here: Netpbm 11.5.2, built from source dated 31 March 2024. The command takes an Amiga .info file as its final argument, or reads one from standard input when you leave the filename off, and writes the converted PAM image to standard output.

$ command -v infotopam
/usr/bin/infotopam
$ infotopam --version 2>&1 | head -n 1
infotopam: Using libnetpbm from Netpbm Version: Netpbm 11.5.2

Use an input path you can read. No elevated privileges are normally needed for conversion:

$ test -r /path/to/icon.info && echo "input is readable"
input is readable

Checkpoint

You have a readable Amiga .info file and know where the new PAM file should go.

2. Convert the normal icon

Each supported .info file stores a normal, unselected image and a selected image. Without an option, infotopam converts the first one. Redirect its standard output to a fresh destination:

$ infotopam /path/to/icon.info > icon-normal.pam

The output is binary image data, so do not expect useful terminal text. Check that the file exists and that Netpbm tools recognise it:

$ file icon-normal.pam
icon-normal.pam: Netpbm image data
$ pamtopnm icon-normal.pam > /tmp/icon-normal.pnm
$ head -n 3 /tmp/icon-normal.pnm
P7
WIDTH ...
HEIGHT ...

The exact file description and PAM header dimensions depend on the icon. What matters is a clean conversion and a readable PAM header. The temporary PNM is only for inspection and can be deleted once you have checked it.

3. Convert the selected image

Use -selected when you need the second image stored in the icon, for example the version an icon shows while it is selected:

$ infotopam -selected /path/to/icon.info > icon-selected.pam
$ file icon-selected.pam

Leave the option off and you get the first image, which is easy to mistake for the selected one when both outputs look similar. Use distinct filenames and note which option produced each file.

Checkpoint

The selected output exists separately from the normal output, and neither source image has been overwritten.

4. Choose bitmap or colour output

The tool handles one- and two-bit-plane icons. A one-bit-plane icon normally becomes a black-and-white PAM image. Add -forcecolor when you need a colour PAM instead:

$ infotopam -forcecolor /path/to/one-bit.info > one-bit-colour.pam
$ pamtopnm one-bit-colour.pam > /tmp/one-bit-colour.pnm

For a forced-colour conversion, the manual defines index 2 as black and index 1 as white. The option only changes how the output is represented; it does not invent colours that were never in the icon data.

5. Override the standard colours

Two-bit-plane icons use colour indexes rather than a full colour per pixel. Netpbm's documented defaults are index 0 blue, index 1 white, index 2 black and index 3 orange. Supply the number of overrides first, then an index colour pair for each one.

$ infotopam -numcolors 2 0 green 3 '#FF0000' /path/to/icon.info > icon-custom.pam
$ pamtopnm icon-custom.pam > /tmp/icon-custom.pnm

Tip

Keep the quotes around #FF0000. An unquoted hash starts a shell comment and swallows the rest of the command. Index values must be between 0 and 3, and colour names or hex values must be in a format Netpbm's colour parser accepts.

Do not claim more overrides than you supply pairs for. The -numcolors value must match the number of pairs that follow it, or the filename shifts or a required argument goes missing.

6. Read from standard input and fix squashed previews

Omit the filename when the icon arrives through a pipe or redirection, which also suits a script that already has the input open:

$ infotopam -selected < /path/to/icon.info > icon-selected.pam

Amiga monitors did not use square pixels, so an otherwise valid icon can look vertically squashed. The manual's fix sends the PAM through pamtopnm and scales the height:

$ infotopam /path/to/squashed.info | pamtopnm | pamscale -yscale 1.7 > icon-normal.pnm

This produces PNM rather than PAM, because pamtopnm is an explicit conversion step. Check that both downstream commands are installed before you rely on the pipeline:

$ command -v pamtopnm pamscale

7. Avoid common failure and overwrite traps

A missing filename or an unreadable file is an input problem, not a reason to run the converter as root. Check the path and permissions first:

$ ls -l /path/to/icon.info
$ test -r /path/to/icon.info && echo readable

Keep redirection targets away from existing work. Shell > truncates its destination before infotopam even starts. For an output that matters, write a temporary file and swap it in only after checking it:

$ infotopam /path/to/icon.info > icon-normal.pam.new
$ file icon-normal.pam.new
$ mv icon-normal.pam.new icon-normal.pam

Warning

That last mv replaces the old output and cannot be undone. If validation fails, stop before it; you can clean up the .new file later. Keep the original .info file regardless, because infotopam has no reverse conversion command.

Done means

  • Version confirmed. infotopam reports the expected installed Netpbm version and the source .info file is readable.
  • Output exists. A PAM file exists for the normal or selected image, with the choice reflected in its filename.
  • Colour flag used correctly. -forcecolor is used only when a one-bit-plane colour PAM is wanted.
  • Overrides match. Every -numcolors invocation has a matching index and colour pair, with shell-special hex colours quoted.
  • Result checked. The output is verified with file or a Netpbm reader, and the original icon is untouched.