In the first code example, a digitized photograph is to be converted into a plan for a tiled mosaic. 5,166 Black Tiles 4,123 Dark Grey Tiles 3,268 White Tiles available to build the mosaic. The code segment will force the distribution of gray scale values in the photograph to match the available distribution of tiles, regardless of the distribution or number of grey values in the original image. The code example results in an image having a flat histogram with values in the range of -10 to 268. The input image must have a gray scale range greater than or equal to the range specified by max and min.
Linear range rescaling merely propagates the coding inefficiencies.
If the same relative contrast between tissue ranges is maintained by linear scaling to a lower gray scale resolution, the fine detail within each range is lost. The resulting image will have a statistical information content very near the target coding range or the original image entropy, whichever is less. Note that the mapping is non-linear, and may complicate analysis of absolute image gray scale value. Spatial convolution forms the basis of the linear filters. Because the convolution integral is itself a linear system, there in no loss of information in convolution with any PSF, and all convolutions are reversible.