---
name: "pnmmargin"
section: "1"
platform: "linux"
package: "netpbm"
version: "10.86.51-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pnmmargin"
---

# pnmmargin(1)

add borders to a PNM image

## NAME

pnmmargin - add borders to a PNM image

## SYNOPSIS

**pnmmargin** \[**-white**\|**-black**\|**-color** *colorspec*\] *size* \[*pnmfile*\]

## DESCRIPTION

This program is part of **Netpbm**(1) .

**pnmmargin** adds a border around a PNM image.

## ARGUMENTS

*pnmfile* is the name of the input file.  If you don't specify this argument, **pnmmargin** reads the input image from its Standard Input.

## OPTIONS

In addition to the options common to all programs based on libnetpbm (most notably **-plain**, see \
  Common Options ⟨index.html#commonoptions⟩ ), **pnmmargin** recognizes the following command line options:

You can specify the border color with the **-white**, **-black**, and **-color** options.  If you don't specify a color, the program makes a guess.

**-white** and **-black** are the same as **-color=white** and **-color=black** respectively (except that the latter fail if you don&apos;t have a color dictionary set up in your environment, so they are really more like **-color=rgbi:0/0/0** and **-color=rgbi:1/1/1**.

The value of **-color** is like the argument of the **pnm\_parsecolor()** library routine ⟨libnetpbm\_image.html#colorname⟩ .

The **-plain** common option was implemented beginning with Netpbm version 10.40 (September 2007).

The **-quiet** common option is not implemented.

## NOTES

**pnmpad** does essentially the same thing, but gives you more control over the individual margins and does only black and white margins.

To remove a border of a specified size from an image, use**pamcut**. **pnmcrop** also removes borders, but determines by itself what is border and what is subject.

If you want to make the image a certain required size, adding borders or cropping as necessary, **pamcut** may be what you want.

## SEE ALSO

- •

  [**pamcut**(1)](/pamcut/1.md)

- •

  [**pnmcrop**(1)](/pnmcrop/1.md)

- •

  [**pamcat**(1)](/pamcat/1.md)

- •

  [**pnmpad**(1)](/pnmpad/1.md)

- •

  **pnm**(1)

## AUTHOR

Copyright (C) 1991 by Jef Poskanzer.

## DOCUMENT SOURCE

This manual page was generated by the Netpbm tool 'makeman' from HTML source.  The master documentation is at

-

  **http://netpbm.sourceforge.net/doc/pnmmargin.html**
