LinuxCommandLibrary

pnmsmooth

Smooth and blur PNM images

TLDR

Smooth/blur image

$ pnmsmooth [input.pnm] > [output.pnm]
copy
Smooth with custom size
$ pnmsmooth -size [5] [input.pnm] > [output.pnm]
copy
Multiple passes
$ pnmsmooth [input.pnm] | pnmsmooth > [output.pnm]
copy

SYNOPSIS

pnmsmooth [options] [pnmfile]

DESCRIPTION

pnmsmooth applies a smoothing (blur) filter to a PNM image using convolution. It averages neighboring pixels to reduce noise and sharp edges.
Wrapper around pnmconvol with a smoothing kernel.

PARAMETERS

-size n

Convolution size (default 3).
-dump file
Dump convolution matrix.

EXAMPLES

$ # Basic smoothing
pnmsmooth noisy.ppm > smooth.ppm

# Stronger smoothing with larger kernel
pnmsmooth -size 5 image.ppm > blurred.ppm

# Multiple smoothing passes
pnmsmooth image.ppm | pnmsmooth | pnmsmooth > very_smooth.ppm

# Reduce noise then enhance
pnmsmooth noisy.pgm | pgmenhance > cleaned.pgm
copy

CONVOLUTION

Default 3x3 averaging kernel:

$ 1 1 1
1 1 1
1 1 1
copy
Larger sizes create stronger blur effect.

CAVEATS

Reduces image sharpness. Use pnmconvol for custom kernels. Part of Netpbm.

HISTORY

pnmsmooth is part of Netpbm by Jef Poskanzer, providing simple image smoothing via convolution.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community