shrink.image | R Documentation |
Shrink resolution of an image
shrink.image(img, method = "median",
xt = img$dim[1], yt = img$dim[2], ratio = TRUE,
compress=TRUE)
img |
image data, an object of class "adimpro". |
method |
method to be used to shrink the image. "median" (default), "mean", or "nearest". "median" is supposed to give best results. For a considerably faster result use "nearest". |
xt |
target x-dimension |
yt |
target y-dimension |
ratio |
logical. preserve x-y ratio? default: |
compress |
logical, determines if image data are stored in raw-format. |
This function shrinkes the resolution of the image such that the x-y
dimension of the resulting image is smaller than the original one.
xt
and yt
give the target dimension
of the image. If ratio == TRUE
(default) the ratio between x- and
y-dimension is preserved.
method
"nearest" selects a pixel nearest to the new coordinates.
method
"mean" defines the color of a pixel as the mean of
all pixel identified with the new coordinate.
method
"median" set the color of a pixel as color of an
L1-generalized median of all pixel identified with the new coordinate.
shrinked image
Karsten Tabelow tabelow@wias-berlin.de and Joerg Polzehl polzehl@wias-berlin.de
## Not run: demo(manipulate)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.