shrink.image(img, method = "median",
xt = img$dim[1], yt = img$dim[2], ratio = TRUE,
compress=TRUE)TRUExt 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.