man > pnmmargin(1)

⚡ TLDR: pnmmargin (tldr-pages)

Add a border to a PNM image.

  • Add a border of the specified size to a PNM image
    pnmmargin {{size}} {{path/to/image.pnm}} > {{path/to/output.pnm}}
  • Specify the color of the border
    pnmmargin {{-c|-color}} {{color}} {{size}} {{path/to/image.pnm}} > {{path/to/output.pnm}}
Pnmmargin User Manual(1)               General Commands Manual              Pnmmargin User Manual(1)

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

       The value of -color is like the argument of the pnm_parsecolor() library routine .

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

       The -quiet common option is not implemented.


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

       For lower level control, including to add different size borders to different  sides  of  the
       image, look at pamcat.

       If all you're trying to do is get the image up to a certain required size, pamcut may be what
       you want.

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



SEE ALSO
       •

              pamcut(1)

       •

              pnmcrop(1)

       •

              pamcat(1)

       •

              pnmpad(1)

       •

              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

netpbm documentation                      12 November 2014                  Pnmmargin User Manual(1)
pnmmargin(1) □✕
NAME SYNOPSIS DESCRIPTION ARGUMENTS OPTIONS NOTES SEE ALSO AUTHOR DOCUMENT SOURCE

Generated by phpman v4.12.13 · Markdown · JSON Author: Che Dong Under GNU General Public License
2026-10-26 03:28 @216.73.217.55
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^