LinuxCommandLibrary

pgmtofs

Convert PGM image format to FITS format

TLDR

Convert the specified PGM image to Usenix FaceSave format

$ pgmtofs [path/to/input.pgm] > [path/to/output.fs]
copy

SYNOPSIS

pgmtofs [-width W] [-height H] [-char C] [PGM_FILE]

PARAMETERS

-width W
    Specifies the width, in pixels, to be used for the font character. If not provided, the width of the input PGM image is used.

-height H
    Specifies the height, in pixels, to be used for the font character. If not provided, the height of the input PGM image is used.

-char C
    Assigns the character code C to the font entry being created. If omitted, the default character code of 0 is used.

PGM_FILE
    The path to the input Portable GreyMap (PGM) image file. If this argument is omitted, pgmtofs reads the PGM data from standard input.

DESCRIPTION

pgmtofs is a Netpbm program that converts a Portable GreyMap (PGM) image file into an Imagen printer font file.

The input PGM image is typically a bilevel (black and white) representation of a character glyph or a bitmap. Imagen printers were once common for high-resolution text output, and this tool enables users to generate custom fonts or bitmap data specifically for these devices from standard PGM format. It takes the PGM data, which can be piped from standard input or read from a file, and outputs the Imagen font data to standard output or a specified file. This command is part of the extensive Netpbm toolkit for image format manipulation.

CAVEATS

The input PGM image must be a bilevel (black and white) image; color or grayscale PGM inputs may not convert correctly or may result in an error. The output format is specific to Imagen printers, which are largely obsolete, limiting the general applicability of the command in modern computing environments.

OUTPUT HANDLING

By default, pgmtofs writes the generated Imagen font data to standard output. Users typically redirect this output to a file using shell redirection, for example:
pgmtofs image.pgm > font.fs

NETPBM PHILOSOPHY

Like many Netpbm tools, pgmtofs adheres to the Unix philosophy of doing one thing well. It focuses solely on the conversion from PGM to Imagen font format, making it suitable for use in shell scripts and pipelines where complex image processing workflows can be built by chaining multiple Netpbm commands together.

HISTORY

pgmtofs is part of the Netpbm project, which originated from the Pbmplus package created by Jef Poskanzer in 1988. Netpbm provides a comprehensive set of tools for converting and manipulating various image formats. pgmtofs was developed at a time when specialized printer font formats, like those for Imagen printers, were important for high-quality text and graphics output. Its continued inclusion in the Netpbm suite reflects the project's goal of maintaining compatibility with a wide range of historical and contemporary image formats and devices.

SEE ALSO

pgm(5), netpbm(1), anytopnm(1), pbmtoibm5250(1), ppmtogs(1)

Copied to clipboard