← 返回命令列表

Linux command

pnm 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

View PNM info

pnmfile [image.pnm]

Convert to other format

pnmtopng [image.pnm] > [image.png]

Convert from other format

pngtopnm [image.png] > [image.pnm]

说明

PNM (Portable Anymap) is an umbrella term for the Netpbm image format family: PBM (bitmap, black and white), PGM (graymap, grayscale), and PPM (pixmap, color). These formats use simple, human-readable headers followed by pixel data in either ASCII or binary encoding. PNM serves as the intermediate format in the Netpbm toolkit, where images are converted to PNM, processed with various pnm* tools, and then converted to the desired output format. The simplicity of PNM makes it easy to generate and parse programmatically.

FAQ

What is the pnm command used for?

PNM (Portable Anymap) is an umbrella term for the Netpbm image format family: PBM (bitmap, black and white), PGM (graymap, grayscale), and PPM (pixmap, color). These formats use simple, human-readable headers followed by pixel data in either ASCII or binary encoding. PNM serves as the intermediate format in the Netpbm toolkit, where images are converted to PNM, processed with various pnm* tools, and then converted to the desired output format. The simplicity of PNM makes it easy to generate and parse programmatically.

How do I run a basic pnm example?

Run `pnmfile [image.pnm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more pnm examples?

This page includes 3 examples for pnm, plus related commands for nearby Linux tasks.