pad: Pad image with n pixels along specified axis

Description Usage Arguments Value Author(s) Examples

View source: R/cimg_class.R

Description

Pad image with n pixels along specified axis

Usage

1
pad(im, nPix, axes, pos = 0, val = rep(0, spectrum(im)))

Arguments

im

the input image

nPix

how many pixels to pad with

axes

which axes to pad along

pos

-1: prepend 0: center 1: append

val

colour of the padded pixels (default 0 in all channels). Can be a string for colour images, e.g. "red", or "black".

Value

a padded image

Author(s)

Simon Barthelme

Examples

1
2
3
4
pad(boats,20,"xy") %>% plot
pad(boats,20,pos=-1,"xy") %>% plot
pad(boats,20,pos=1,"xy") %>% plot
pad(boats,20,pos=1,"xy",val="red") %>% plot

imager documentation built on May 30, 2018, 9:04 a.m.