pampick
Select authentication modules using PAM configuration
TLDR
Execute a shell command on each image in a Netpbm file
SYNOPSIS
pampick [Netpbm_common_options] pick_argument
PARAMETERS
-verbose
Prints informational messages to standard error describing the actions and progress of the command.
-plain
(Netpbm common option) For Netpbm programs that can output both plain (ASCII) and raw (binary) formats, this option specifies plain output. However, PAM images are inherently binary, so this option typically has no effect on pampick's output format.
DESCRIPTION
pampick is a utility from the Netpbm suite designed for selecting and extracting specific pixels or regions from a Portable Anymap (PAM) image. It reads a PAM image from standard input, applies a selection logic defined by its 'pick' argument, and then writes a new PAM image containing only the selected pixels to standard output.
This command is incredibly useful in image processing pipelines, allowing users to precisely control which parts of an image are passed to subsequent Netpbm tools or other image manipulation programs. It can pick single pixels, rectangular regions, or even grids of pixels within a specified area, making it a flexible tool for various image analysis and transformation tasks. Its design philosophy aligns with the Unix tradition of small, focused utilities that do one thing well and can be chained together.
CAVEATS
The input image must be in the Portable Anymap (PAM) format. If the input is not a valid PAM, pampick will report an error. The 'pick' argument's syntax is strict and must be correctly formatted to avoid errors or unexpected selections.
As with most Netpbm tools, performance on extremely large images might be limited by system memory and processing power, though it's generally efficient for its intended purpose.
THE PICK ARGUMENT SYNTAX
The pick_argument is the core mechanism by which pampick determines which pixels to select. It is a comma-separated string specifying coordinates and dimensions.
The coordinate system used is top-left (0,0), with X increasing to the right and Y increasing downwards.
Possible formats for pick_argument include:
x,y: Selects a single pixel at the specified column (x) and row (y).
x,y,width,height: Selects a rectangular region starting at (x,y) with the given width and height.
x,y,width,height,xstep,ystep: Selects a grid of pixels within the specified rectangular region, picking every xstep-th pixel horizontally and every ystep-th pixel vertically.
INPUT AND OUTPUT
pampick operates as a filter program, reading its input image from standard input (stdin) and writing the resulting image to standard output (stdout). This design makes it highly suitable for use in shell pipelines, where its output can be directly fed as input to another Netpbm tool or a different command, facilitating complex image processing workflows.
HISTORY
pampick is an integral part of the Netpbm package, which evolved from the original PBMplus toolkit. Netpbm maintains a long and stable history as a fundamental suite of Unix-like image processing tools. pampick was developed to extend the pixel-level manipulation capabilities, offering a more granular selection mechanism than tools like pamcut, which primarily deals with rectangular regions.