pad: Pad image with n pixels along specified axis

View source: R/cimg_class.R

padR Documentation

Pad image with n pixels along specified axis

Description

Pad image with n pixels along specified axis

Usage

pad(im, nPix, axes, pos = 0, val)

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


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 29, 2024, 1:38 a.m.