LinuxCommandLibrary

pamscale

resizes PAM/PNM images using high-quality resampling

TLDR

Scale to specific size

$ pamscale -width [800] -height [600] [input.pam] > [output.pam]
copy
Scale by factor
$ pamscale [0.5] [input.pam] > [half.pam]
copy
Scale preserving aspect ratio
$ pamscale -xyfit [800] [600] [input.pam] > [output.pam]
copy
Scale width only
$ pamscale -xsize [800] [input.pam] > [output.pam]
copy
High quality scaling
$ pamscale -filter=lanczos [0.5] [input.pam] > [output.pam]
copy

SYNOPSIS

pamscale [options] [scale] [pamfile]

DESCRIPTION

pamscale resizes PAM/PNM images using high-quality resampling. It can scale by factor, to specific dimensions, or fit within a bounding box while preserving aspect ratio.

PARAMETERS

scale

Scale factor (0.5 = half).
-width, -xsize n
Output width.
-height, -ysize n
Output height.
-xyfit w h
Fit within box, keep aspect.
-filter name
Resampling filter.
-linear
Linear interpolation.

FILTERS

$ point    - Nearest neighbor
box      - Box filter
triangle - Linear/bilinear
lanczos  - High quality (default)
copy

CAVEATS

Upscaling may blur. Very small scales may lose detail. Large images need memory.

HISTORY

pamscale is part of Netpbm, providing high-quality image scaling with various resampling algorithms.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community