← 返回命令列表

Linux command

pnmconvol 命令

趣味

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Apply convolution matrix

pnmconvol [matrix.pgm] [input.pnm] > [output.pnm]

Create blur effect

pnmconvol -matrix=[1,1,1;1,1,1;1,1,1] [input.pnm] > [output.pnm]

Edge detection

pnmconvol -matrix=[-1,-1,-1;-1,8,-1;-1,-1,-1] [input.pnm] > [output.pnm]

说明

pnmconvol applies convolution matrix filters to PNM images for effects like blurring, sharpening, and edge detection. The convolution kernel can be specified as a PGM file or inline with the -matrix option. Each output pixel is computed as the weighted sum of surrounding input pixels according to the kernel values. Part of the Netpbm toolkit for image processing.

参数

-matrix _SPEC_
Specify convolution matrix inline (e.g., "1,1,1;1,1,1;1,1,1").
-matrixfile _FILE_
Read convolution matrix from a file.
-normalize
Scale weights to sum to one, preserving overall image brightness.
-bias _n_
Amount to add to each convolved sample value, useful for handling negative results.
-nooffset
Normalize matrix values by dividing by maxval instead of using offset calculations.

FAQ

What is the pnmconvol command used for?

pnmconvol applies convolution matrix filters to PNM images for effects like blurring, sharpening, and edge detection. The convolution kernel can be specified as a PGM file or inline with the -matrix option. Each output pixel is computed as the weighted sum of surrounding input pixels according to the kernel values. Part of the Netpbm toolkit for image processing.

How do I run a basic pnmconvol example?

Run `pnmconvol [matrix.pgm] [input.pnm] > [output.pnm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -matrix _SPEC_ do in pnmconvol?

Specify convolution matrix inline (e.g., "1,1,1;1,1,1;1,1,1").