# Set intensity range

Scales or clamps the gray levels or color channels of an image into a given range.

## Inputs

image
Input image.
mode
Mode of operation.
min
minimum gray level.
max
maximum gray level.

## Outputs

image
a grayscale image with the smallest possible number of bits per pixel.

Supported operation modes.

Enumerator
Cap

Cap the existing range to the new range. Everything below min will be set to min and everything above max will be set to max.

Stretch

Stretch the existing range to the new range. The minimum intensity level of the input will be moved to min and the maximum to max. The rest will be uniformly scaled in between.

CapAndStretch

First Cap the existing range to the new range, then stretch the range to [channel_min, channel_max].

Scale

Scale the range from [channel_min, channel_max] to the new range. For example, you can scale any (e.g 10-bit or binary) image to an 8-bit image by setting min = 0 and max = 255.