← 返回命令列表

Linux command

pgm 命令

文件

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

常用示例

View PGM format info

pamfile [image.pgm]

Convert JPEG to PGM

jpegtopnm [image.jpg] | ppmtopgm > [output.pgm]

Create PGM from text

echo "P2 3 2 255 0 128 255 64 192 32" > [output.pgm]

Display PGM image

display [image.pgm]

说明

PGM (Portable Graymap) is a grayscale image format in the Netpbm family. It stores images as grayscale values from 0 (black) to maxval (white). Simple ASCII or binary format, easy to read and write programmatically.

FAQ

What is the pgm command used for?

PGM (Portable Graymap) is a grayscale image format in the Netpbm family. It stores images as grayscale values from 0 (black) to maxval (white). Simple ASCII or binary format, easy to read and write programmatically.

How do I run a basic pgm example?

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

Where can I find more pgm examples?

This page includes 4 examples for pgm, plus related commands for nearby Linux tasks.