imsubsample2 {imageUtilities}R Documentation

subsample an image to at most a certain size

Description

subsample an image to at most a certain size

Usage

  imsubsample2(src, maxSize, method = c("every", "mean"),
    strict = TRUE)

Arguments

src

input image to downsample

maxSize

c(width,height) specifying the maximum size the output image is permitted to be. NA for dimensions you don't care about.

method

'every' or 'mean'. See imsubsample.

strict

whether to strictly enforce the image being at most maxSize, or allow slightly bigger if that works better than the smaller option.

Value

input image subsampled such that it is at *most* maxSize.

Note

The factor to downsample by must be an integer, so the integer chosen is ceiling(size/maxSize) if strict=TRUE, and round(size/maxSize) otherwise.

Aspect ratio is preserved.

See Also

imsubsample.


[Package imageUtilities version 1.0.3 Index]