Learn R Programming

imager (version 0.40.2)

pad: 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 = 0)

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

value to fill the padding with (default 0)

Value

a padded image

Examples

Run this code
# NOT RUN {
pad(boats,20,"xy") %>% plot
pad(boats,20,pos=-1,"xy") %>% plot
pad(boats,20,pos=1,"xy") %>% plot
# }

Run the code above in your browser using DataLab