Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

padimage

Pad the Border of a Pixel Image


Description

Fills the border of a pixel image with a given value or values, or extends a pixel image to fill a larger window.

Usage

padimage(X, value=NA, n=1, W=NULL)

Arguments

X

Pixel image (object of class "im").

value

Single value to be placed around the border of X.

n

Width of border, in pixels. See Details.

W

Window for the resulting image. Incompatible with n.

Details

The image X will be expanded by a margin of n pixels, or extended to fill the window W, with new pixel values set to value.

The argument value should be a single value (a vector of length 1), normally a value of the same type as the pixel values of X. It may be NA. Alternatively if X is a factor-valued image, value can be one of the levels of X.

If n is given, it may be a single number, specifying the width of the border in pixels. Alternatively it may be a vector of length 2 or 4. It will be replicated to length 4, and these numbers will be interpreted as the border widths for the (left, right, top, bottom) margins respectively.

Alternatively if W is given, the image will be extended to the window W.

Value

Another object of class "im", of the same type as X.

Author(s)

and Ege Rubak rubak@math.aau.dk

See Also

Examples

Z <- setcov(owin())
 plot(padimage(Z, 1, 10))

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.