- DIP - Computer Vision and Graphics
- DIP - Optical Character Recognition
- DIP - JPEG compression
- DIP - Introduction to Color Spaces
- DIP - High Pass vs Low Pass Filters
- DIP - Convolution theorm
- DIP - Fourier series and Transform
- DIP - Frequency Domain Analysis
- DIP - Laplacian Operator
- DIP - Krisch Compass Mask
- DIP - Robinson Compass Mask
- DIP - Sobel operator
- DIP - Prewitt Operator
- DIP - Concept of Edge Detection
- DIP - Concept of Blurring
- DIP - Concept of Masks
- DIP - Concept of convolution
- DIP - Gray Level Transformations
- DIP - Histogram Equalization
- DIP - Introduction to Probability
- DIP - Histogram Stretching
- DIP - Histogram Sliding
- DIP - Image Transformations
- DIP - Brightness and Contrast
- DIP - Histograms Introduction
- DIP - Concept of Dithering
- DIP - ISO Preference curves
- DIP - Concept of Quantization
- DIP - Gray Level Resolution
- DIP - Pixels Dots and Lines per inch
- DIP - Spatial Resolution
- DIP - Zooming methods
- DIP - Concept of Zooming
- DIP - Pixel Resolution
- DIP - Concept of Sampling
- DIP - Grayscale to RGB Conversion
- DIP - Color Codes Conversion
- DIP - Types of Images
- DIP - Concept of Bits Per Pixel
- DIP - Perspective Transformation
- DIP - Concept of Pixel
- DIP - Camera Mechanism
- DIP - Image Formation on Camera
- DIP - Concept of Dimensions
- DIP - Applications and Usage
- DIP - History of Photography
- DIP - Signal and System Introduction
- DIP - Image Processing Introduction
- DIP - Home
DIP Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Concept of Quantization
We have introduced quantization in our tutorial of signals and system. We are formally going to relate it with digital images in this tutorial. Lets discuss first a pttle bit about quantization.
Digitizing a signal
As we have seen in the previous tutorials, that digitizing an analog signal into a digital, requires two basic steps. Samppng and quantization. Samppng is done on x axis. It is the conversion of x axis (infinite values) to digital values.
The below figure shows samppng of a signal.
![samppng](/dip/images/samppng.jpg)
Samppng with relation to digital images
The concept of samppng is directly related to zooming. The more samples you take, the more pixels, you get. Oversamppng can also be called as zooming. This has been discussed under samppng and zooming tutorial.
But the story of digitizing a signal does not end at samppng too, there is another step involved which is known as Quantization.
What is quantization
Quantization is opposite to samppng. It is done on y axis. When you are quantizing an image, you are actually spaniding a signal into quanta(partitions).
On the x axis of the signal, are the co-ordinate values, and on the y axis, we have ampptudes. So digitizing the ampptudes is known as Quantization.
Here how it is done
![quantization](/dip/images/quantization.jpg)
You can see in this image, that the signal has been quantified into three different levels. That means that when we sample an image, we actually gather a lot of values, and in quantization, we set levels to these values. This can be more clear in the image below.
![quantization levels](/dip/images/quantization_levels.jpg)
In the figure shown in samppng, although the samples has been taken, but they were still spanning vertically to a continuous range of gray level values. In the figure shown above, these vertically ranging values have been quantized into 5 different levels or partitions. Ranging from 0 black to 4 white. This level could vary according to the type of image you want.
The relation of quantization with gray levels has been further discussed below.
Relation of Quantization with gray level resolution:
The quantized figure shown above has 5 different levels of gray. It means that the image formed from this signal, would only have 5 different colors. It would be a black and white image more or less with some colors of gray. Now if you were to make the quapty of the image more better, there is one thing you can do here. Which is, to increase the levels, or gray level resolution up. If you increase this level to 256, it means you have an gray scale image. Which is far better then simple black and white image.
Now 256, or 5 or what ever level you choose is called gray level. Remember the formula that we discussed in the previous tutorial of gray level resolution which is,
![bpp](/dip/images/bpp.jpg)
We have discussed that gray level can be defined in two ways. Which were these two.
Gray level = number of bits per pixel (BPP).(k in the equation)
Gray level = number of levels per pixel.
In this case we have gray level is equal to 256. If we have to calculate the number of bits, we would simply put the values in the equation. In case of 256levels, we have 256 different shades of gray and 8 bits per pixel, hence the image would be a gray scale image.
Reducing the gray level
Now we will reduce the gray levels of the image to see the effect on the image.
For example
Lets say you have an image of 8bpp, that has 256 different levels. It is a grayscale image and the image looks something pke this.
256 Gray Levels
![einstein](/dip/images/einstein.jpg)
Now we will start reducing the gray levels. We will first reduce the gray levels from 256 to 128.
128 Gray Levels
![128](/dip/images/128.jpg)
There is not much effect on an image after decrease the gray levels to its half. Lets decrease some more.
64 Gray Levels
![64](/dip/images/64.jpg)
Still not much effect, then lets reduce the levels more.
32 Gray Levels
![32](/dip/images/32.jpg)
Surprised to see, that there is still some pttle effect. May be its due to reason, that it is the picture of Einstein, but lets reduce the levels more.
16 Gray Levels
![16](/dip/images/16.jpg)
Boom here, we go, the image finally reveals, that it is effected by the levels.
8 Gray Levels
![8](/dip/images/8.jpg)
4 Gray Levels
![4](/dip/images/4.jpg)
Now before reducing it, further two 2 levels, you can easily see that the image has been distorted badly by reducing the gray levels. Now we will reduce it to 2 levels, which is nothing but a simple black and white level. It means the image would be simple black and white image.
2 Gray Levels
![2](/dip/images/2.jpg)
Thats the last level we can achieve, because if reduce it further, it would be simply a black image, which can not be interpreted.
Contouring
There is an interesting observation here, that as we reduce the number of gray levels, there is a special type of effect start appearing in the image, which can be seen clear in 16 gray level picture. This effect is known as Contouring.
Iso preference curves
The answer to this effect, that why it appears, pes in Iso preference curves. They are discussed in our next tutorial of Contouring and Iso preference curves.
Advertisements