img_pad_to_size: Pad image so that it is of the specified size

Description Usage Arguments Examples

View source: R/utils.R

Description

Pad image so that it is of the specified size

Usage

1
img_pad_to_size(img, size = dim(img), value = 0)

Arguments

img

image

size

dimensions of the output image (cannot be smaller than the current dimensions)

value

fill value to use for padding the image. If value has the same length as the number of frames in the image, it will be applied frame-wise.

Examples

1
2
3
4
5
6
7
8
9
par(mfrow = c(1, 2))
im <- EBImage::readImage(system.file('images', 'nuclei.tif', package='EBImage'))[,,1:3]
EBImage::colorMode(im) <- "Color"
dim(im)
plot(im)

im_pad <- img_pad_to_size(im, size = c(550, 540), value = c(0, 1, 0))
dim(im_pad)
plot(im_pad, all = TRUE)

srvanderplas/ShoeScrubR documentation built on Nov. 27, 2019, 2:09 p.m.