pamedge

Edge-detect a PNM/PAM image

TLDR

Detect edges in an image
$ pamedge [input.pam] > [output.pam]
Detect edges from pipe
$ cat [image.pam] | pamedge > [edges.pam]
Detect edges and threshold to black and white
$ pamedge [input.pam] | pamditherbw -threshold > [edges.pbm]

SYNOPSIS

pamedge [imagefile]

DESCRIPTION

pamedge reads a Netpbm image (PNM or PAM) and produces an output image that outlines the edges. It uses the Pythagorean sum of two Sobel gradient operators at 90 degrees to each other for edge detection.The output format matches the input, except the minimum maxval is 255. PBM input is converted to PGM output. For sharper bilevel edge images, pipe the output through pamditherbw -threshold.Part of the Netpbm toolkit. Supersedes pgmedge, which only handled PGM and PBM formats.

PARAMETERS

imagefile

Input PAM or PNM image file. Reads from standard input if omitted.

INSTALL

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

CAVEATS

Has no command-line options beyond standard libnetpbm options. For better results with low maxval images, increase the maxval with pamdepth before processing.

HISTORY

pamedge was added to Netpbm in 2003 as a replacement for pgmedge, extending support to all PAM and PNM image formats.

SEE ALSO

pgmedge(1), pgmenhance(1), pamditherbw(1), pamdepth(1), pnmconvol(1), netpbm(1)