pnmtoddif

convert a PNM image to a DEC DDIF document

TLDR

Convert PNM to DDIF
$ pnmtoddif [input.pnm] > [output.ddif]
Specify the output resolution in DPI
$ pnmtoddif -resolution [300] [input.pnm] > [output.ddif]
Read from stdin
$ cat [input.pnm] | pnmtoddif > [output.ddif]

SYNOPSIS

pnmtoddif [-resolution dpi] [pnmfile]

DESCRIPTION

pnmtoddif translates a PNM image (PBM, PGM, or PPM) into a DEC DDIF (Digital Document Interchange Format) document on standard output. DDIF is a compound-document format used by DEC's CDA (Compound Document Architecture), most notably in DECwindows applications and document tools that ship with VMS and Ultrix.The converter preserves the bit depth of the input: a PBM becomes a 1-bit DDIF page, a PGM becomes grayscale, and a PPM becomes 24-bit color. The output resolution recorded in the DDIF header is -resolution (default 75 DPI), influencing how downstream viewers scale the image.

PARAMETERS

PNMFILE

Input PNM (PBM, PGM, or PPM) image. If omitted, pnmtoddif reads from standard input.
-resolution N
Embed the given resolution (dots per inch) in the DDIF output. Defaults to 75 DPI.

INSTALL

sudo apt install netpbm
sudo dnf install netpbm
sudo pacman -S netpbm
sudo apk add netpbm
sudo zypper install netpbm
brew install netpbm
nix profile install nixpkgs#netpbm

CAVEATS

DDIF is a legacy format; viewers and converters outside of the historical DEC/Compaq toolchain are rare. There is no built-in converter from DDIF back to PNM in current Netpbm releases.

HISTORY

pnmtoddif was contributed to Netpbm to support interoperability with DEC Compound Document Architecture tooling. It remains in the distribution mostly for archival and legacy purposes.

SEE ALSO

pnmtops(1), pnmtopng(1), pamtopnm(1)