pgmtofs
Convert PGM image format to FITS format
TLDR
Convert the specified PGM image to Usenix FaceSave format
SYNOPSIS
pgmtofs [-compact] [-maxsize=N] [-verbose] [pgminfile [fsoutfile]]
PARAMETERS
-compact
Omit blank space at the end of each row, producing a smaller file. Default pads each row to 11 bytes.
-maxsize=N
Fail with an error if the output file would exceed N bytes in size.
-verbose
Print progress messages to standard error while processing.
DESCRIPTION
pgmtofs is a utility from the Netpbm graphics toolkit that converts a PGM (Portable Graymap) image into a .FS filesystem image file used by Psion palmtop computers, such as the Psion 3 series (3a, 3c, 3mx, 5mx, S3a, S5). These .FS files store monochrome bitmaps for icons, wallpapers, or other graphics in the Psion's EPOC operating system.
The input image must be precisely 84 pixels wide by 48 pixels high. It supports only black (0) and white (255) pixels; any intermediate gray values are thresholded to black or white using a simple midpoint threshold. The output is a compact binary representation optimized for Psion hardware.
Common use cases include creating custom bitmaps for Psion applications or transferring simple graphics to these vintage PDAs. If the input dimensions are incorrect, the program fails with an error. By default, each row is padded to 11 bytes (84 bits = 10.5 bytes, rounded up), but the -compact option removes trailing blank space for smaller files.
CAVEATS
Input PGM must be exactly 84x48 pixels with only 0 (black) or 255 (white) values; grays are thresholded. Reads from stdin, writes to stdout if files omitted. Not suitable for color or larger images.
EXAMPLE
pgmtofs -compact icon.pgm icon.fs
Converts icon.pgm (84x48 PGM) to compact icon.fs.
OUTPUT FORMAT
Produces Psion-compatible .FS binary: 11-byte rows (compact or padded), exactly 528 bytes default size.
HISTORY
Introduced in Netpbm around the mid-1990s to support Psion palmtop users converting Unix/Linux graphics for EPOC PDAs. Maintained as part of the open-source Netpbm project, with updates for portability across Unix-like systems.


