pamstretch
scale up a Netpbm image by integer factors with interpolation
TLDR
SYNOPSIS
pamstretch [-xscale=X] [-yscale=Y] [-blackedge|-dropedge] N [file]
DESCRIPTION
pamstretch scales up a PAM, PNM, PPM, PGM, or PBM image by integer factors, interpolating between neighboring source pixels rather than simply replicating them. This yields smoother results than plain pixel duplication for photographs and other continuous-tone images.The tool supports independent horizontal and vertical factors through -xscale and -yscale, or a single uniform factor given as the final positional argument. Edge behaviour is configurable: by default extra pixels are synthesised, -blackedge fades to black, and -dropedge trims the trailing row and column.
PARAMETERS
N
Uniform integer stretch factor applied to both axes when -xscale/-yscale are not given.-xscale=X
Integer horizontal scale factor (default 1 if only -yscale is given).-yscale=Y
Integer vertical scale factor (default 1 if only -xscale is given).-blackedge
Interpolate toward black at the right and bottom edges, preserving output dimensions.-dropedge
Drop one source pixel at the right and bottom edges. Produces a cleaner result but yields non-standard output dimensions (width * N - N + 1).file
Input PAM/PNM file. Reads from standard input if omitted.
CAVEATS
Only integer scale factors are supported; for non-integer scaling use pamstretch-gen or pamscale. Option names accept minimum unambiguous abbreviations and may use single or double hyphens.
HISTORY
pamstretch is part of the Netpbm toolkit, a set of graphics file manipulation utilities originating from Jef Poskanzer's pbmplus package (1988). It was introduced as an interpolating alternative to pnmenlarge, which only replicates pixels.
SEE ALSO
pamstretch-gen(1), pamscale(1), pnmenlarge(1), pnmscale(1), pam(5), pnm(5)
