From 3f4d11380b956eb101c58117b30e4b804770a6b9 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 30 Nov 2023 22:36:25 +0000 Subject: miscellaneous update git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@4797 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- pnmpad.html | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/pnmpad.html b/pnmpad.html index f20f7fea..785e80f7 100644 --- a/pnmpad.html +++ b/pnmpad.html @@ -13,7 +13,13 @@ pnmpad - add borders to a PNM image

SYNOPSIS

pnmpad -[-white|-black] +[-color=color +[-promote={none|format|all}] +|-detect-background +|-extend-edge +|-white +|-black +]
[-width=pixels] [-halign=ratio] @@ -71,11 +77,34 @@ use either white space or an equals sign between an option name and its value.
+
-color=color +
-detect-background +
-extend-edge
-white
-black -
Set pad color. Default is -black. +
This specifies the color of the padding. color is like +the argument of +the pnm_parsecolor() library routine. +

-detect-background means the program uses the color of the +top left pixel of the input as the pad color. Note that this could cause +odd results if you aren't padding the top or left of the image. + +

You may specify only one of -white, -black, -color, +and -detect-background. + +

-extend-edge says to pad by duplicating the adjacent edge of the +image pixel by pixel. E.g. if the top row of the image is 20 white pixels +followed by 10 black pixels, every row of padding added to the top of the +image is 20 white pixels followed by 20 black pixels. + +

By default, the padding is black. + +

-white and -black are for backward compatibility. +-color, -detect-background, and -extend-edge were new +with Netpbm 11.05 (December 2023). +

-left=pixels
-right=pixels
-width=width @@ -146,6 +175,39 @@ when -mwidth is specified and the other options indicate no padding. These options determine the vertical padding. They are analogous to the horizontal padding options above. +
-promote={none|format|all} + +
This option tells what to do when the -color option specifies a +color that cannot be represented in the input format, which ordinarily is also +the output format. For example, if the input is PGM (which can represent only +shades of gray), and you specify -color=red, should pnmpad make +the padding gray or make the output PPM? + +
+
none +
Make the output have the same format and maxval as the input. + Adjust the pad color to the nearest color possible in that format + (black, white, or a shade of gray). +
format +
Make the output have the same maxval as the input, but make + the output format PPM if the pad color is not black, white, or gray. +
all +
Make the format and maxval of the output capable of representing the + pad color. Make the format the least expressive format capable of + representing the pad color. Make the maxval the larger of 255 and + the maxval of the input image. +
+ +

The default is -promote=all. + +

Note that this promotion happens even if no actual padding happens, meaning +it isn't really necessary. The promotion is based on +what would be required to represent padding of the specified color. + +

This option is valid only when you also specify -color. + +

This option was new in Netpbm 11.05 (December 2023). +

-reportonly
This causes pnmpad to write to Standard Output a description of the -- cgit 1.4.1