LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pnmconvol

Apply convolution filters to PNM images

TLDR

Apply convolution matrix
$ pnmconvol [matrix.pgm] [input.pnm] > [output.pnm]
copy
Create blur effect
$ pnmconvol -matrix=[1,1,1;1,1,1;1,1,1] [input.pnm] > [output.pnm]
copy
Edge detection
$ pnmconvol -matrix=[-1,-1,-1;-1,8,-1;-1,-1,-1] [input.pnm] > [output.pnm]
copy

SYNOPSIS

pnmconvol [options] convolution input

DESCRIPTION

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.

PARAMETERS

CONVOLUTION

Convolution matrix as a PGM file.
INPUT
Input PNM image file.
-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.

INSTALL

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

CAVEATS

Part of Netpbm. Matrix defines effect. Slow for large kernels.

HISTORY

pnmconvol is part of Netpbm for convolution operations.

SEE ALSO

pamedge(1), pnmsmooth(1), netpbm(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid