pgmedge
detects edges in a PGM grayscale image using the Sobel edge detection algorithm
TLDR
Detect edges in image
$ pgmedge [input.pgm] > [output.pgm]
From another format$ jpegtopnm [image.jpg] | ppmtopgm | pgmedge > [edges.pgm]
Chain with conversion$ pgmedge [input.pgm] | pnmtopng > [edges.png]
SYNOPSIS
pgmedge [pgmfile]
DESCRIPTION
pgmedge detects edges in a PGM grayscale image using the Sobel edge detection algorithm. Output is a PGM where bright pixels indicate edges.
PARAMETERS
pgmfile
Input PGM file. Uses stdin if not specified.
Basic edge detection
pgmedge photo.pgm > edges.pgm
From JPEG
jpegtopnm photo.jpg | ppmtopgm | pgmedge > edges.pgm
Complete pipeline
jpegtopnm photo.jpg | ppmtopgm | pgmedge | pnmtopng > edges.png
$
# ALGORITHM
Uses Sobel operator:
- Computes horizontal and vertical gradients
- Combines to detect edges
- Brighter output = stronger edge
# CAVEATS
Input must be grayscale PGM. For color images, convert first with ppmtopgm. Consider pamedge for more options.
# HISTORY
pgmedge is part of **Netpbm** by **Jef Poskanzer** and contributors, implementing classic image processing algorithms.
# SEE ALSO
pamedge(1), pgmenhance(1), ppmtopgm(1), netpbm(1)
# ALGORITHM
Uses Sobel operator:
- Computes horizontal and vertical gradients
- Combines to detect edges
- Brighter output = stronger edge
# CAVEATS
Input must be grayscale PGM. For color images, convert first with ppmtopgm. Consider pamedge for more options.
# HISTORY
pgmedge is part of **Netpbm** by **Jef Poskanzer** and contributors, implementing classic image processing algorithms.
# SEE ALSO
pamedge(1), pgmenhance(1), ppmtopgm(1), netpbm(1)
