← 返回命令列表

Linux command

pamstretch 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Stretch an image 2x in both dimensions

pamstretch [2] [input.pam] > [output.pam]

Stretch 3x and drop the extra edge pixel

pamstretch -dropedge [3] [input.pam] > [output.pam]

Stretch horizontally only

pamstretch -xscale=[4] -yscale=[1] [input.pam] > [output.pam]

Stretch vertically only

pamstretch -xscale=[1] -yscale=[2] [input.pam] > [output.pam]

Interpolate to black

pamstretch -blackedge [2] [input.pam] > [output.pam]

Stretch from standard input

cat [input.pnm] | pamstretch [2] > [output.pnm]

说明

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.

参数

-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).

FAQ

What is the pamstretch command used for?

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.

How do I run a basic pamstretch example?

Run `pamstretch [2] [input.pam] > [output.pam]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -xscale=_X_ do in pamstretch?

Integer horizontal scale factor (default 1 if only -yscale is given).