LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pgmedge

detects edges in a PGM grayscale image using the Sobel edge detection algorithm

TLDR

Detect edges in image
$ pgmedge [input.pgm] > [output.pgm]
copy
From another format
$ jpegtopnm [image.jpg] | ppmtopgm | pgmedge > [edges.pgm]
copy
Chain with conversion
$ pgmedge [input.pgm] | pnmtopng > [edges.png]
copy

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 strong edges.The algorithm computes the horizontal and vertical image gradients using Sobel kernels and combines them, producing a single intensity per pixel proportional to the local gradient magnitude.

PARAMETERS

pgmfile

Input PGM file. Uses stdin if not specified.

CAVEATS

Input must be a grayscale PGM. Convert color images with ppmtopgm first. pgmedge is the legacy tool — pamedge offers more options including thresholding and direction output.

HISTORY

pgmedge is part of Netpbm by Jef Poskanzer and contributors, implementing classic image processing algorithms.

SEE ALSO

Copied to clipboard
Kai