Gray scale is generally expressed as 0-255. The more quantization levels, the richer the image levels, the higher the gray resolution and the better the image quality, but the larger the data volume. The fewer quantization levels, the less rich the image levels, the lower the gray resolution, the more false contour phenomena, the worse the image quality, but the less data.
The quantization of image gray level is a process of transforming the continuous brightness change interval corresponding to image pixels into a single specific value, that is, discretizing the spatial coordinate amplitude of the original gray level image.