LinuxCommandLibrary

pnmpad

Add padding to PNM images

TLDR

Add padding to image

$ pnmpad -left [10] -right [10] [input.pnm] > [output.pnm]
copy
Add uniform padding
$ pnmpad -width [100] -height [100] [input.pnm] > [output.pnm]
copy
Pad with specific color
$ pnmpad -color [white] -left [5] [input.pnm] > [output.pnm]
copy

SYNOPSIS

pnmpad [options] [file]

DESCRIPTION

pnmpad adds padding (blank space) around PNM images, extending the canvas size without scaling the original content. Padding can be added independently to each side using -left, -right, -top, and -bottom.
Alternatively, -width and -height specify the desired output dimensions, centering the original image within the new canvas. The -color option sets the padding color (default is black). This is the inverse of pnmcrop. Part of the Netpbm toolkit.

PARAMETERS

FILE

Input PNM file.
-left N
Pixels to add on left.
-right N
Pixels to add on right.
-top N
Pixels to add on top.
-bottom N
Pixels to add on bottom.
-width N
Target width (centered).
-height N
Target height (centered).
-color COLOR
Padding color.

CAVEATS

Opposite of pnmcrop. Part of Netpbm suite.

HISTORY

pnmpad was created as part of Netpbm for image padding operations.

SEE ALSO

pnmcrop(1), pamcomp(1), pnmcat(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community