SpatialPack (version 0.4)

clipping: Clipping image

Description

This function returns the image which restricts pixel value from the specified range.

Usage

clipping(img, low = 0, high = 1)

Value

grayscale image matrix with the same size as img.

Arguments

img

input grayscale image matrix.

low

lowest value.

high

highest value.

Examples

Run this code
data(texmos2)
plot(as.raster(texmos2))

# the appearance of next one doesn't change because of normalization
x <- normalize(2 * texmos2)
plot(as.raster(x))
title(main = "Doubled pixel value with normalization", font.main = 1)

# the next one is saturated as expected
x <- clipping(2 * texmos2)
plot(as.raster(x))
title(main = "Doubled pixel value with clipping", font.main = 1)

Run the code above in your browser using DataLab