Use scale and clip to scale an image's intensity levels to lie between a minimum and maximum, or truncate them to a minimum and maximum. The processed images are scaled or clipped to a standard grayscale range of 0–255.
This function converts the relative intensities of an image to lie between the optional values Min and Max, or between the default range of 0–255, by using the following algorithm:
1. Define an image matrix M.
2. Scale matrix M into the range 0–255.
3. Verify that scaling using the default Min and Max yields the same scaled matrix.
clip
This function truncates all intensities below the optional value Min to Min and all intensities above the optional value Max to Max.
Clipping can be used to remove unwanted features, noise, or extraneous information from an image.
1. Clip matrix M into the range 0–255.
Clipping using the default Min and Max yields the same scaled matrix:
2. Remove the bright spots from a picture.
The brightest spot in the clipped image is 220 instead of 255 as in original image:
3. Compare the clipped image with the original image.