Class: PadAugmenter

PadAugmenter(opts)

Add padding to the image

Constructor

new PadAugmenter(opts)

Parameters:
Name Type Description
opts Object

options, if number or array, considered as size argument

Properties
Name Type Attributes Default Description
percent ArraylRTB

size of padding in percent

size ArraylRTB

size of padding in piwels

borderValue ColorArgument <optional>
[0,0,0]

if borderType is "constant" this is used as border pixel values

borderType BorderTypeArgument <optional>
"constant"

"constant", "replicate", "transparent"

Source:
Examples
// Simple usage, pad by 10px, on every side
ia.pad(10);
// pad by 10%, with transparent background
ia.pad({
	percent: 0.1,
	borderType: "transparent"
});
// pad by 10% (left, right), 20% (top, bottom), with constant blue background
ia.pad({
	percent: [0.1, 0.2],
	borderType: "transparent",
	borderValue: [0, 0, 255]
});